提交 248da27c 编写于 作者: J Jiacheng Shi 提交者: Jialin Zhang

vfio/iommu_type1: replace kfree with kvfree

virt inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6FHYK
CVE: NA

Reference: https://github.com/torvalds/linux/commit/2bed2ced40c97b8540ff38df0149e8ecb2bf4c65

--------------------------------

[ Upstream commit 2bed2ced ]

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: NJiacheng Shi <billsjc@sjtu.edu.cn>
Link: https://lore.kernel.org/r/20211212091600.2560-1-billsjc@sjtu.edu.cnSigned-off-by: NAlex Williamson <alex.williamson@redhat.com>
Signed-off-by: NKunkun Jiang <jiangkunkun@huawei.com>
Reviewed-by: NKeqian Zhu <zhukeqian1@huawei.com>
Signed-off-by: NJialin Zhang <zhangjialin11@huawei.com>
上级 3da6ee13
...@@ -241,7 +241,7 @@ static int vfio_dma_bitmap_alloc(struct vfio_dma *dma, size_t pgsize) ...@@ -241,7 +241,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;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册