Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 308be22b authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "cnss2: Avoid null pointer dereference in cnss2"

parents 3acd91a2 798f739e
Loading
Loading
Loading
Loading
+8 −1
Original line number Original line Diff line number Diff line
@@ -1860,9 +1860,16 @@ int cnss_pci_unregister_driver_hdlr(struct cnss_pci_data *pci_priv)
static bool cnss_pci_is_drv_supported(struct cnss_pci_data *pci_priv)
static bool cnss_pci_is_drv_supported(struct cnss_pci_data *pci_priv)
{
{
	struct pci_dev *root_port = pci_find_pcie_root_port(pci_priv->pci_dev);
	struct pci_dev *root_port = pci_find_pcie_root_port(pci_priv->pci_dev);
	struct device_node *root_of_node = root_port->dev.of_node;
	struct device_node *root_of_node;
	bool drv_supported = false;
	bool drv_supported = false;


	if (!root_port) {
		cnss_pr_err("PCIe DRV is not supported as root port is null\n");
		return drv_supported;
	}

	root_of_node = root_port->dev.of_node;

	if (root_of_node->parent)
	if (root_of_node->parent)
		drv_supported = of_property_read_bool(root_of_node->parent,
		drv_supported = of_property_read_bool(root_of_node->parent,
						      "qcom,drv-supported");
						      "qcom,drv-supported");
+3 −3
Original line number Original line Diff line number Diff line
@@ -775,12 +775,12 @@ int cnss_wlfw_wlan_cfg_send_sync(struct cnss_plat_data *plat_priv,
	u32 i;
	u32 i;
	int ret = 0;
	int ret = 0;


	cnss_pr_dbg("Sending WLAN config message, state: 0x%lx\n",
		    plat_priv->driver_state);

	if (!plat_priv)
	if (!plat_priv)
		return -ENODEV;
		return -ENODEV;


	cnss_pr_dbg("Sending WLAN config message, state: 0x%lx\n",
		    plat_priv->driver_state);

	req = kzalloc(sizeof(*req), GFP_KERNEL);
	req = kzalloc(sizeof(*req), GFP_KERNEL);
	if (!req)
	if (!req)
		return -ENOMEM;
		return -ENOMEM;