Loading
iommufd: viommu: free memory allocated by kvcalloc() using kvfree()
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: 2238ddc2 ("iommufd/viommu: Add IOMMUFD_CMD_HW_QUEUE_ALLOC ioctl") Link: https://patch.msgid.link/r/aJifyVV2PL6WGEs6@bhairav-test.ee.iitb.ac.in Signed-off-by:Akhilesh Patil <akhilesh@ee.iitb.ac.in> Reviewed-by:
Kevin Tian <kevin.tian@intel.com> Reviewed-by:
Nicolin Chen <nicolinc@nvidia.com> Reviewed-by:
Pranjal Shrivastava <praan@google.com> Signed-off-by:
Jason Gunthorpe <jgg@nvidia.com>