1
0
Fork 0
mirror of synced 2025-03-06 20:59:54 +01:00
linux/drivers/pci/endpoint/functions
Zhongqiu Han 5089b3d874
PCI: endpoint: epf-mhi: Avoid NULL dereference if DT lacks 'mmio'
If platform_get_resource_byname() fails and returns NULL because DT lacks
an 'mmio' property for the MHI endpoint, dereferencing res->start will
cause a NULL pointer access. Add a check to prevent it.

Fixes: 1bf5f25324 ("PCI: endpoint: Add PCI Endpoint function driver for MHI bus")
Link: https://lore.kernel.org/r/20241105120735.1240728-1-quic_zhonhan@quicinc.com
Signed-off-by: Zhongqiu Han <quic_zhonhan@quicinc.com>
[kwilczynski: error message update per the review feedback]
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Niklas Cassel <cassel@kernel.org>
2024-11-16 18:20:11 +00:00
..
Kconfig PCI: endpoint: Add PCI Endpoint function driver for MHI bus 2023-06-23 15:05:49 -05:00
Makefile PCI: endpoint: Add PCI Endpoint function driver for MHI bus 2023-06-23 15:05:49 -05:00
pci-epf-mhi.c PCI: endpoint: epf-mhi: Avoid NULL dereference if DT lacks 'mmio' 2024-11-16 18:20:11 +00:00
pci-epf-ntb.c PCI: endpoint: Clean up hardware description for BARs 2024-02-16 20:30:46 +05:30
pci-epf-test.c PCI: endpoint: Remove surplus return statement from pci_epf_test_clean_dma_chan() 2024-11-16 18:20:11 +00:00
pci-epf-vntb.c PCI: endpoint: Fix error handling in epf_ntb_epc_cleanup() 2024-07-04 14:40:53 +00:00