mwlwifi: update to version 10.4.10-20231120
[openwrt/staging/hauke.git] / package / kernel / mwlwifi / patches / 004-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch
1 From 8e809b241695252e397bf0d7fc5f36e115c38831 Mon Sep 17 00:00:00 2001
2 From: Robert Marko <robert.marko@sartura.hr>
3 Date: Fri, 5 Mar 2021 11:47:59 +0100
4 Subject: [PATCH] mwlwifi: fix PCIe DT node null pointer dereference
5
6 pci_bus_to_OF_node() used to get the PCI bus DT node
7 returns node if found or NULL if none is found.
8
9 Since the return of pci_bus_to_OF_node() is not checked in
10 the DT node name print it will cause a null pointer
11 dereference and crash the kernel.
12
13 So first check whether the node is not NULL and then print.
14
15 Signed-off-by: Robert Marko <robert.marko@sartura.hr>
16 ---
17 hif/pcie/pcie.c | 3 ++-
18 1 file changed, 2 insertions(+), 1 deletion(-)
19
20 --- a/hif/pcie/pcie.c
21 +++ b/hif/pcie/pcie.c
22 @@ -685,7 +685,8 @@ static struct device_node *pcie_get_devi
23 struct device_node *dev_node;
24
25 dev_node = pci_bus_to_OF_node(pcie_priv->pdev->bus);
26 - wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name);
27 + if (dev_node)
28 + wiphy_info(priv->hw->wiphy, "device node: %s\n", dev_node->full_name);
29
30 return dev_node;
31 }