kaloz / mwlwifi

mac80211 driver for the Marvell 88W8864 802.11ac chip
396 stars 119 forks source link

mwlwifi: fix PCIe DT node null pointer dereference #420

Open neheb opened 7 months ago

neheb commented 7 months ago

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.

jbsky commented 7 months ago

I'd like to understand the use case of this commit.

There's a use case where reloading the module is a problem. In the case of module unloading, no problem, openwrt continues to work. When the module is reloaded, the kernel crashes without giving any sign of life. This commit does not correct this use case.

neheb commented 7 months ago

ping @robimarko

robimarko commented 7 months ago

The use case is that last time I tried to use this driver on Espressobin Ultra with a 88W8897 card it would crash on pci_bus_to_OF_node() returning NULL