* [dpdk-dev] [PATCH] mem: fix mem leak issue when attaching a PCI device without driver to DPDK
@ 2021-06-28 9:02 RickZhong
2021-06-28 9:25 ` David Marchand
0 siblings, 1 reply; 2+ messages in thread
From: RickZhong @ 2021-06-28 9:02 UTC (permalink / raw)
To: dev; +Cc: RickZhong
when trying to attach a PCI device without driver to DPDK,
the 'dev' is malloced but not freed.
Signed-off-by: RickZhong <winsome8282@163.com>
---
drivers/bus/pci/linux/pci.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c
index 0dc99e9cb..909502ecc 100644
--- a/drivers/bus/pci/linux/pci.c
+++ b/drivers/bus/pci/linux/pci.c
@@ -332,6 +332,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)
dev->kdrv = RTE_PCI_KDRV_UNKNOWN;
} else {
dev->kdrv = RTE_PCI_KDRV_NONE;
+ free(dev);
return 0;
}
/* device is valid, add in list (sorted) */
--
2.18.4
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-06-28 9:25 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28 9:02 [dpdk-dev] [PATCH] mem: fix mem leak issue when attaching a PCI device without driver to DPDK RickZhong
2021-06-28 9:25 ` David Marchand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).