Re: [PATCH] iommufd: viommu: free memory allocated by kvcalloc() using kvfree()
From: Jason Gunthorpe
Date: Mon Aug 18 2025 - 10:36:12 EST
On Sun, Aug 10, 2025 at 07:04:01PM +0530, Akhilesh Patil wrote:
> Use kvfree() instead of kfree() to free pages allocated by kvcalloc()
> in iommufs_hw_queue_alloc_phys() to fix potential memory corruption.
> Ensure the memory is properly freed, as kvcalloc may internally use
> vmalloc or kmalloc depending on available memory in the system.
>
> Fixes: 2238ddc2b056 ("iommufd/viommu: Add IOMMUFD_CMD_HW_QUEUE_ALLOC ioctl")
> Signed-off-by: Akhilesh Patil <akhilesh@xxxxxxxxxxxxx>
> ---
> drivers/iommu/iommufd/viommu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
Applied to for-rc
Thanks,
Jason