From: Yunjian Wang Date: Fri, 11 Sep 2020 10:57:42 +0000 (+0800) Subject: bus/pci: fix memory leak when unmapping VFIO resource X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=e34a43a6729dd33e430e1815a395893fe1c643d6;p=dpdk.git bus/pci: fix memory leak when unmapping VFIO resource 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 Acked-by: Anatoly Burakov --- diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index d2073994fa..940ebc1e35 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -1015,7 +1015,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; }