Re: [PATCH] iommufd/selftest: Fix page leaks in mock_viommu_{init,destroy}

From: Nicolin Chen

Date: Thu Mar 12 2026 - 15:57:25 EST


On Thu, Mar 12, 2026 at 05:40:42PM +0100, Thorsten Blum wrote:
> mock_viommu_init() allocates two pages using __get_free_pages(..., 1),
> but its error path and mock_viommu_destroy() only release the first page
> using free_page(), leaking the second page. Use free_pages() with the
> matching order instead to avoid any page leaks.
>
> Fixes: 80478a2b450e ("iommufd/selftest: Add coverage for the new mmap interface")
> Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>

Reviewed-by: Nicolin Chen <nicolinc@xxxxxxxxxx>