TencentOS-kernel/drivers/vfio
Xiaoyang Xu 1f837a61cd vfio iommu type1: Fix memory leak in vfio_iommu_type1_pin_pages
[ Upstream commit 2e6cfd496f5b57034cf2aec738799571b5a52124 ]

pfn is not added to pfn_list when vfio_add_to_pfn_list fails.
vfio_unpin_page_external will exit directly without calling
vfio_iova_put_vfio_pfn.  This will lead to a memory leak.

Fixes: a54eb55045ae ("vfio iommu type1: Add support for mediated devices")
Signed-off-by: Xiaoyang Xu <xuxiaoyang2@huawei.com>
[aw: simplified logic, add Fixes]
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-03-16 16:39:03 +08:00
..
mdev vfio/mdev: Fix reference count leak in add_mdev_supported_type 2021-03-16 16:30:27 +08:00
pci vfio/pci: Clear token on bypass registration failure 2021-03-16 16:39:03 +08:00
platform vfio: platform: Switch to platform_get_irq_optional() 2021-03-16 16:26:13 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vfio.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vfio_iommu_spapr_tce.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
vfio_iommu_type1.c vfio iommu type1: Fix memory leak in vfio_iommu_type1_pin_pages 2021-03-16 16:39:03 +08:00
vfio_spapr_eeh.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
virqfd.c Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00