Skip to content

Commit

Permalink
mwlwifi: fix PCIe DT node null pointer dereference
Browse files Browse the repository at this point in the history
pci_bus_to_OF_node() used to get the PCI bus DT node
returns node if found or NULL if none is found.

Since the return of pci_bus_to_OF_node() is not checked in
the DT node name print it will cause a null pointer
dereference and crash the kernel.

So first check whether the node is not NULL and then print.

Signed-off-by: Robert Marko <[email protected]>
  • Loading branch information
robimarko authored and jbsky committed Sep 10, 2024
1 parent bcaf476 commit 189ea3c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion hif/pcie/pcie.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,8 @@ static struct device_node *pcie_get_device_node(struct ieee80211_hw *hw)
struct device_node *dev_node;

dev_node = pci_bus_to_OF_node(pcie_priv->pdev->bus);
wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name);
if (dev_node)
wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name);

return dev_node;
}
Expand Down

0 comments on commit 189ea3c

Please sign in to comment.