openwrt/package/kernel/mwlwifi/patches/010-mwlwifi-fix-PCIe-DT-node-null-pointer-dereference.patch
Rosen Penev 2d6e433e1d mwlwifi: fix compilation with 6.6 and 64-bit
Upstream patch updated to fix kernel 6.6 compilation. It was also split
up into 5. Do the same here.

The patches are taken from this upstreasm PR:
https://github.com/kaloz/mwlwifi/pull/413

Renamed other patches so as to not overlap.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/15452
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
2024-10-19 18:57:50 +02:00

32 lines
1.0 KiB
Diff

From 8e809b241695252e397bf0d7fc5f36e115c38831 Mon Sep 17 00:00:00 2001
From: Robert Marko <robert.marko@sartura.hr>
Date: Fri, 5 Mar 2021 11:47:59 +0100
Subject: [PATCH] mwlwifi: fix PCIe DT node null pointer dereference
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 <robert.marko@sartura.hr>
---
hif/pcie/pcie.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/hif/pcie/pcie.c
+++ b/hif/pcie/pcie.c
@@ -685,7 +685,8 @@ static struct device_node *pcie_get_devi
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;
}