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

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.cnSigned-off-by: default avatarAlex Williamson <alex.williamson@redhat.com>
parent 21ab7995
......@@ -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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment