
13 Dec
2021
13 Dec
'21
11:48 a.m.
Variables allocated by kvmalloc should not be freed by kfree. Because they may be allocated by vmalloc. So we replace kfree with kvfree here. Fixes: 738fe155f58b ("vfio/iommu_type1: Add support for manual dirty log clear") Signed-off-by: Jiacheng Shi <billsjc@sjtu.edu.cn> --- drivers/vfio/vfio_iommu_type1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c index 5daceec48811..6811a85109aa 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -1150,7 +1150,7 @@ static int vfio_iova_dirty_log_clear(u64 __user *bitmap, } out: - kfree(bitmap_buffer); + kvfree(bitmap_buffer); return ret; } -- 2.17.1