numam-dpdk/drivers
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
..
baseband cleanup compat header inclusions 2022-11-15 08:39:14 +01:00
bus bus/pci: fix leak with multiple bus scan 2022-11-22 16:07:56 +01:00
common cleanup compat header inclusions 2022-11-15 08:39:14 +01:00
compress drivers: remove unused build variable 2022-11-22 13:35:32 +01:00
crypto drivers: remove unused build variable 2022-11-22 13:35:32 +01:00
dma cleanup compat header inclusions 2022-11-15 08:39:14 +01:00
event cleanup compat header inclusions 2022-11-15 08:39:14 +01:00
gpu drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
mempool cleanup compat header inclusions 2022-11-15 08:39:14 +01:00
net net/nfp: fix return path in TSO processing 2022-11-22 02:59:21 +01:00
raw drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
regex drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00
vdpa drivers: remove unused build variable 2022-11-22 13:35:32 +01:00
meson.build drivers: omit symbol map when unneeded 2022-11-14 15:22:46 +01:00