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

Commit 798f739e authored by Sandeep Singh's avatar Sandeep Singh
Browse files

cnss2: Avoid null pointer dereference in cnss2



Add change to avoid null pointer dereference.

Change-Id: I3767c6e932d3b4afc7f1fd256b29fb1b170f15f4
Signed-off-by: default avatarSandeep Singh <sandsing@codeaurora.org>
parent efe4f92d
Loading
Loading
Loading
Loading
+8 −1
Original line number 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)
{
	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;

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

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

	if (!plat_priv)
		return -ENODEV;

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

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