Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mwlwifi: fix PCIe DT node null pointer dereference #420

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

neheb
Copy link
Contributor

@neheb neheb commented Apr 19, 2024

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.

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]>
@jbsky
Copy link
Contributor

jbsky commented Apr 21, 2024

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
Copy link
Contributor Author

neheb commented Apr 21, 2024

ping @robimarko

@robimarko
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants