bus/pci: fix leak for unbound devices
PATCH 1/1 bus/pci: fix leak for unbound devices
For devices not bound to any Linux kernel module, we leak a pci object since it is never added to the PCI bus device list.
Fixes c79a1c67465d ("bus/pci: optimize bus scan")
Reported-by Owen Hilyard <[email protected]>
Signed-off-by David Marchand <[email protected]>
--- drivers/bus/pci/linux/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/bus/pci/linux/pci.c +1 -1
@@ -331,7 +331,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)else dev->kdrv =RTE_PCI_KDRV_UNKNOWN ; }else { - dev->kdrv =RTE_PCI_KDRV_NONE ; +free (dev);return 0 ; }/* device is valid, add in list (sorted) */
Signature · 1 line
2.23.0
Quoted 9 lines · David Marchand
For devices not bound to any Linux kernel module, we leak a pci object since it is never added to the PCI bus device list.
Fixes c79a1c67465d ("bus/pci: optimize bus scan")Reported-by Owen Hilyard <[email protected]>Signed-off-by David Marchand <[email protected]>
No objection?
There is no dedicated maintainer, I'll merge this then.
Signature · 1 line
David Marchand
David Marchand
AppliedQuoted 9 lines · David Marchand
For devices not bound to any Linux kernel module, we leak a pci object since it is never added to the PCI bus device list.
Fixes c79a1c67465d ("bus/pci: optimize bus scan")Reported-by Owen Hilyard <[email protected]>Signed-off-by David Marchand <[email protected]>
Applied.
Signature · 1 line
David Marchand