Re: [PATCH rc 2/4] iommufd/selftest: Add missing close(mfd) in memfd_mmap()
From: Jason Gunthorpe
Date: Mon Jun 16 2025 - 12:27:21 EST
On Sun, Jun 15, 2025 at 10:02:04PM -0700, Nicolin Chen wrote:
> Do not forget to close mfd in the error paths, since none of the callers
> would close it when ASSERT_NE(MAP_FAILED, buf) fails.
>
> Fixes: 0bcceb1f51c7 ("iommufd: Selftest coverage for IOMMU_IOAS_MAP_FILE")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Nicolin Chen <nicolinc@xxxxxxxxxx>
> ---
> tools/testing/selftests/iommu/iommufd_utils.h | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
Reviewed-by: Jason Gunthorpe <jgg@xxxxxxxxxx>
Jason