All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 5.10 5.15] vfio/iommu_type1: replace kfree with kvfree
@ 2026-06-19 15:02 Nikolay Kuratov
  2026-06-19 15:13 ` sashiko-bot
  2026-06-21 13:47 ` Sasha Levin
  0 siblings, 2 replies; 3+ messages in thread
From: Nikolay Kuratov @ 2026-06-19 15:02 UTC (permalink / raw)
  To: stable
  Cc: linux-kernel, kvm, Kirti Wankhede, Yan Zhao, Nikolay Kuratov,
	Jiacheng Shi, Alex Williamson

From: Jiacheng Shi <billsjc@sjtu.edu.cn>

From: Jiacheng Shi <billsjc@sjtu.edu.cn>

commit 2bed2ced40c97b8540ff38df0149e8ecb2bf4c65 upstream.

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>
Signed-off-by: Nikolay Kuratov <kniv@yandex-team.ru>
---
 drivers/vfio/vfio_iommu_type1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/vfio/vfio_iommu_type1.c b/drivers/vfio/vfio_iommu_type1.c
index f17490ab238f..9394aa9444c1 100644
--- a/drivers/vfio/vfio_iommu_type1.c
+++ b/drivers/vfio/vfio_iommu_type1.c
@@ -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;
 }
 
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-06-21 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-19 15:02 [PATCH 5.10 5.15] vfio/iommu_type1: replace kfree with kvfree Nikolay Kuratov
2026-06-19 15:13 ` sashiko-bot
2026-06-21 13:47 ` Sasha Levin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.