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 <wangyunjian@huawei.com>
Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
This commit is contained in:
Yunjian Wang 2020-09-11 18:57:42 +08:00 committed by David Marchand
parent 4b10ae8027
commit e34a43a672

View File

@ -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;
}