numam-dpdk/drivers/bus/pci
David Marchand db4092276a bus/pci: fix leak with multiple bus scan
The addition of the bus_info field did not account for the fact that the
PCI bus can be scanned multiple times (like for device hotplug and other
uses in SPDK).
Indeed, during pci_scan_one() for devices that were already registered,
the pci_common_set() overwrites the bus_info field, leaking the
previously allocated memory.

Since the bus_info content is fixed for a PCI device, we can simply skip
allocation if dev->bus_info is already set.

Fixes: 8f4de2dba9 ("bus/pci: fill bus specific information")

Reported-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Signed-off-by: David Marchand <david.marchand@redhat.com>
2022-11-22 16:07:56 +01:00
..
bsd drivers/bus: set device NUMA node to unknown by default 2022-10-06 21:26:55 +02:00
linux bus/pci: remove VFIO status log in scan 2022-10-10 17:54:46 +02:00
windows drivers/bus: set device NUMA node to unknown by default 2022-10-06 21:26:55 +02:00
bus_pci_driver.h bus/pci: fill bus specific information 2022-09-23 16:14:34 +02:00
meson.build bus/pci: make driver-only headers private 2022-09-23 16:14:34 +02:00
pci_common_uio.c drivers: check interrupt file descriptor validity 2021-11-08 17:32:42 +01:00
pci_common.c bus/pci: fix leak with multiple bus scan 2022-11-22 16:07:56 +01:00
pci_params.c dev: hide driver object 2022-09-23 16:14:34 +02:00
private.h bus/pci: fill bus specific information 2022-09-23 16:14:34 +02:00
rte_bus_pci.h cleanup compat header inclusions 2022-11-15 08:39:14 +01:00
version.map bus/pci: make driver-only headers private 2022-09-23 16:14:34 +02:00