Skip to content

Commit 2bed2ce

Browse files
shijc-sjtuawilliam
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alex Williamson <[email protected]>
1 parent 21ab799 commit 2bed2ce

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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)