vfio: fix mem leak when unmapping resource
diff mbox series

Message ID 20200614140034.E5CDC49E0@dpdk.org
State Deferred
Delegated to: David Marchand
Headers show
  • vfio: fix mem leak when unmapping resource
Related show


Context Check Description
ci/Intel-compilation success Compilation OK
ci/iol-testing success Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/travis-robot success Travis build: passed
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/checkpatch success coding style OK

Commit Message

Yunjian Wang June 14, 2020, 1:59 p.m. UTC
The 'vfio_res' is not freed when unmapping resource by primary process.
This leads to memory leak.

Fixes: ab53203e194b ("vfio: enable unmapping resource for secondary")
Cc: stable@dpdk.org

Signed-off-by: Yunjian Wang <yunjian.wang@foxmail.com>
 drivers/bus/pci/linux/pci_vfio.c | 1 +
 1 file changed, 1 insertion(+)

diff mbox series

diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c
index 64cd84a68..bf4c3c1fa 100644
--- a/drivers/bus/pci/linux/pci_vfio.c
+++ b/drivers/bus/pci/linux/pci_vfio.c
@@ -966,6 +966,7 @@  pci_vfio_unmap_resource_primary(struct rte_pci_device *dev)
 	TAILQ_REMOVE(vfio_res_list, vfio_res, next);
+	rte_free(vfio_res);
 	return 0;