summaryrefslogtreecommitdiffstats
path: root/drivers/vfio/vfio_iommu_type1.c
diff options
context:
space:
mode:
authorJiacheng Shi <billsjc@sjtu.edu.cn>2021-12-12 01:16:00 -0800
committerAlex Williamson <alex.williamson@redhat.com>2021-12-21 12:30:34 -0700
commit2bed2ced40c97b8540ff38df0149e8ecb2bf4c65 (patch)
tree7585943e25b117eaafb462e4a1ea3e46cf2eb059 /drivers/vfio/vfio_iommu_type1.c
parent21ab799585762e097387da82a4e0fd6c2ffb4000 (diff)
downloadlinux-stable-2bed2ced40c97b8540ff38df0149e8ecb2bf4c65.tar.gz
linux-stable-2bed2ced40c97b8540ff38df0149e8ecb2bf4c65.tar.bz2
linux-stable-2bed2ced40c97b8540ff38df0149e8ecb2bf4c65.zip
vfio/iommu_type1: replace kfree with kvfree
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 <billsjc@sjtu.edu.cn> Link: https://lore.kernel.org/r/20211212091600.2560-1-billsjc@sjtu.edu.cn Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio/vfio_iommu_type1.c')
-rw-r--r--drivers/vfio/vfio_iommu_type1.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index f17490ab238f..9394aa9444c1 100644
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@ -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;
}