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>
This commit is contained in:
Jiacheng Shi 2021-12-12 01:16:00 -08:00 committed by Alex Williamson
parent 21ab799585
commit 2bed2ced40

View 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) static void vfio_dma_bitmap_free(struct vfio_dma *dma)
{ {
kfree(dma->bitmap); kvfree(dma->bitmap);
dma->bitmap = NULL; dma->bitmap = NULL;
} }