Skip to content

Commit

Permalink
bus/pci: fix leak for unbound devices
Browse files Browse the repository at this point in the history
[ upstream commit 7c83a1e ]

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: c79a1c6 ("bus/pci: optimize bus scan")

Reported-by: Owen Hilyard <ohilyard@iol.unh.edu>
Signed-off-by: David Marchand <david.marchand@redhat.com>
  • Loading branch information
david-marchand authored and bluca committed Jul 12, 2021
1 parent a3519aa commit dbf3401
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/bus/pci/linux/pci.c
Expand Up @@ -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) */
Expand Down

0 comments on commit dbf3401

Please sign in to comment.