numam-dpdk/drivers/bus
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
..
auxiliary bus/auxiliary: prevent device from being probed again 2022-11-14 11:15:44 +01:00
dpaa bus/dpaa: fix build with clang 15 2022-11-21 11:19:10 +01:00
fslmc cleanup compat header inclusions 2022-11-15 08:39:14 +01:00
ifpga bus: hide bus object 2022-09-23 16:14:34 +02:00
pci bus/pci: fix leak with multiple bus scan 2022-11-22 16:07:56 +01:00
vdev bus/vdev: fix crash in device cleanup 2022-10-20 11:35:07 +02:00
vmbus cleanup compat header inclusions 2022-11-15 08:39:14 +01:00
meson.build bus/auxiliary: introduce auxiliary bus 2021-07-05 18:11:28 +02:00