]> Git Repo - J-linux.git/commitdiff
vfio/iommu_type1: replace kfree with kvfree
authorJiacheng Shi <[email protected]>
Sun, 12 Dec 2021 09:16:00 +0000 (01:16 -0800)
committerAlex Williamson <[email protected]>
Tue, 21 Dec 2021 19:30:34 +0000 (12:30 -0700)
Variables allocated by kvzalloc should not be freed by kfree.
Because they may be allocated by vmalloc.
So we replace kfree with kvfree here.

Fixes: d6a4c185660c ("vfio iommu: Implementation of ioctl for dirty pages tracking")
Signed-off-by: Jiacheng Shi <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alex Williamson <[email protected]>
drivers/vfio/vfio_iommu_type1.c

index f17490ab238f46d4fbf63bd66b0ab95cfe855d52..9394aa9444c10c565ce2ffa2aefcfd6b39048f8b 100644 (file)
@@ -256,7 +256,7 @@ static int vfio_dma_bitmap_alloc(struct vfio_dma *dma, size_t pgsize)
 
 static void vfio_dma_bitmap_free(struct vfio_dma *dma)
 {
-       kfree(dma->bitmap);
+       kvfree(dma->bitmap);
        dma->bitmap = NULL;
 }
 
This page took 0.052169 seconds and 4 git commands to generate.