Commit 2bed2ced authored by Jiacheng Shi's avatar Jiacheng Shi Committed by Alex Williamson
Browse files

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: d6a4c185 ("vfio iommu: Implementation of ioctl for dirty pages tracking")
Signed-off-by: default avatarJiacheng Shi <billsjc@sjtu.edu.cn>
Link: https://lore.kernel.org/r/20211212091600.2560-1-billsjc@sjtu.edu.cn


Signed-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 21ab7995
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}