1
0
Fork 0
alistair23-linux/drivers/vfio
Xiaoyang Xu b4035b3d64 vfio iommu type1: Fix memory leak in vfio_iommu_type1_pin_pages
[ Upstream commit 2e6cfd496f ]

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: a54eb55045 ("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>
2020-10-29 09:57:56 +01:00
..
mdev vfio/mdev: Fix reference count leak in add_mdev_supported_type 2020-06-24 17:50:36 +02:00
pci vfio/pci: Clear token on bypass registration failure 2020-10-29 09:57:56 +01:00
platform vfio: platform: Switch to platform_get_irq_optional() 2020-04-17 10:50:19 +02:00
Kconfig docs: driver-api: add a series of orphaned documents 2019-07-15 11:03:02 -03:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
vfio.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
vfio_iommu_spapr_tce.c mm: introduce page_shift() 2019-09-24 15:54:08 -07:00
vfio_iommu_type1.c vfio iommu type1: Fix memory leak in vfio_iommu_type1_pin_pages 2020-10-29 09:57:56 +01:00
vfio_spapr_eeh.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
virqfd.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00