bus/pci: fix leak on VFIO mapping error
authorYunjian Wang <wangyunjian@huawei.com>
Fri, 11 Sep 2020 11:08:04 +0000 (19:08 +0800)
committerDavid Marchand <david.marchand@redhat.com>
Mon, 5 Oct 2020 08:08:57 +0000 (10:08 +0200)
commit2a089d2d52f45bca6f179345fa3f3abe1a0e2ea9
tree9a9cd8d5915b60751b649fc9c1480fafae14bcff
parente34a43a6729dd33e430e1815a395893fe1c643d6
bus/pci: fix leak on VFIO mapping error

Currently, only the 'vfio_dev_fd' is closed in failure path, so
some resources are not released(such as 'vfio_group_fd'). The
rte_vfio_release_device() should be used to avoid this problem.

Fixes: 33604c31354a ("vfio: refactor PCI BAR mapping")
Cc: stable@dpdk.org
Signed-off-by: Yunjian Wang <wangyunjian@huawei.com>
Reviewed-by: Anatoly Burakov <anatoly.burakov@intel.com>
drivers/bus/pci/linux/pci_vfio.c