Skip to content

Commit 2bed2ce

Browse files
shijc-sjtuAlex Williamson
authored andcommitted
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: d6a4c18 ("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>
1 parent 21ab799 commit 2bed2ce

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/vfio/vfio_iommu_type1.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ static int vfio_dma_bitmap_alloc(struct vfio_dma *dma, size_t pgsize)
256256

257257
static void vfio_dma_bitmap_free(struct vfio_dma *dma)
258258
{
259-
kfree(dma->bitmap);
259+
kvfree(dma->bitmap);
260260
dma->bitmap = NULL;
261261
}
262262

0 commit comments

Comments
 (0)