Skip to content
Commit c0cb1cf2 authored by Xiaoyang Xu's avatar Xiaoyang Xu Committed by bgman111111
Browse files

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: a54eb550 ("vfio iommu type1: Add support for mediated devices")
Signed-off-by: default avatarXiaoyang Xu <xuxiaoyang2@huawei.com>
[aw: simplified logic, add Fixes]
Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent b078ee3f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment