WSL2-Linux-Kernel/drivers/pci/endpoint
Dan Carpenter 24414c842a PCI: endpoint: Clean up error handling in vpci_scan_bus()
[ Upstream commit 8e0f5a96c534f781e8c57ca30459448b3bfe5429 ]

Smatch complains about inconsistent NULL checking in vpci_scan_bus():

    drivers/pci/endpoint/functions/pci-epf-vntb.c:1024 vpci_scan_bus() error: we previously assumed 'vpci_bus' could be null (see line 1021)

Instead of printing an error message and then crashing we should return
an error code and clean up.

Also the NULL check is reversed so it prints an error for success
instead of failure.

Fixes: e35f56bb03 ("PCI: endpoint: Support NTB transfer between RC and EP")
Link: https://lore.kernel.org/linux-pci/68e0f6a4-fd57-45d0-945b-0876f2c8cb86@moroto.mountain
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Krzysztof Wilczyński <kwilczynski@kernel.org>
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-19 05:45:06 +02:00
..
functions PCI: endpoint: Clean up error handling in vpci_scan_bus() 2024-08-19 05:45:06 +02:00
Kconfig PCI: consolidate PCI config entry in drivers/pci 2018-11-23 11:45:34 +09:00
Makefile PCI: Add SPDX GPL-2.0 when no license was specified 2018-01-26 11:45:16 -06:00
pci-ep-cfs.c PCI: endpoint: Add support to link a physical function to a virtual function 2021-08-19 14:13:28 +01:00
pci-epc-core.c PCI: endpoint: Add virtual function number in pci_epc ops 2021-08-19 14:13:28 +01:00
pci-epc-mem.c PCI: Fix kerneldoc warnings 2020-08-05 18:23:14 -05:00
pci-epf-core.c pci-v5.15-changes 2021-09-07 19:13:42 -07:00