Variables allocated by kvmalloc should not be freed by kfree. Because they may be allocated by vmalloc. So we replace kfree with kvfree here.
Fixes: 738fe155f58b ("vfio/iommu_type1: Add support for manual dirty log clear") Signed-off-by: Jiacheng Shi billsjc@sjtu.edu.cn --- 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 5daceec48811..6811a85109aa 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -1150,7 +1150,7 @@ static int vfio_iova_dirty_log_clear(u64 __user *bitmap, }
out: - kfree(bitmap_buffer); + kvfree(bitmap_buffer); return ret; }
Hi Jiacheng,
Reviewed-by: Keqian Zhu zhukeqian1@huawei.com
这是一个有效补丁,good job!
ps:后续补丁可以抄送一下相关maintainer和原补丁作者,可以让你的补丁得到更快响应。
Thanks, Keqian
On 2021/12/13 11:48, Jiacheng Shi wrote:
Variables allocated by kvmalloc should not be freed by kfree. Because they may be allocated by vmalloc. So we replace kfree with kvfree here.
Fixes: 738fe155f58b ("vfio/iommu_type1: Add support for manual dirty log clear") Signed-off-by: Jiacheng Shi billsjc@sjtu.edu.cn
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 5daceec48811..6811a85109aa 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -1150,7 +1150,7 @@ static int vfio_iova_dirty_log_clear(u64 __user *bitmap, }
out:
- kfree(bitmap_buffer);
- kvfree(bitmap_buffer); return ret;
}
On 2021/12/13 19:45, Keqian Zhu wrote:
Hi Jiacheng,
Reviewed-by: Keqian Zhu zhukeqian1@huawei.com
这是一个有效补丁,good job!
ps:后续补丁可以抄送一下相关maintainer和原补丁作者,可以让你的补丁得到更快响应。
原补丁作者,要是参与openEuler的才可以;-),不要抄送没有参与openEuler社区的其他作者, 免得视为打扰。
再次感谢 Jiacheng 的补丁!
Thanks, Keqian
On 2021/12/13 11:48, Jiacheng Shi wrote:
Variables allocated by kvmalloc should not be freed by kfree. Because they may be allocated by vmalloc. So we replace kfree with kvfree here.
Fixes: 738fe155f58b ("vfio/iommu_type1: Add support for manual dirty log clear") Signed-off-by: Jiacheng Shi billsjc@sjtu.edu.cn
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 5daceec48811..6811a85109aa 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -1150,7 +1150,7 @@ static int vfio_iova_dirty_log_clear(u64 __user *bitmap, }
out:
- kfree(bitmap_buffer);
- kvfree(bitmap_buffer); return ret;
}
.
On 2021/12/13 20:29, Xie XiuQi wrote:
On 2021/12/13 19:45, Keqian Zhu wrote:
Hi Jiacheng,
Reviewed-by: Keqian Zhu zhukeqian1@huawei.com
这是一个有效补丁,good job!
ps:后续补丁可以抄送一下相关maintainer和原补丁作者,可以让你的补丁得到更快响应。
原补丁作者,要是参与openEuler的才可以;-),不要抄送没有参与openEuler社区的其他作者, 免得视为打扰。
是的,感谢XiuQi更正。刚好这个特性是自己人开发的,类似这种才可以。
Thanks, Keqian
再次感谢 Jiacheng 的补丁!
Thanks, Keqian
On 2021/12/13 11:48, Jiacheng Shi wrote:
Variables allocated by kvmalloc should not be freed by kfree. Because they may be allocated by vmalloc. So we replace kfree with kvfree here.
Fixes: 738fe155f58b ("vfio/iommu_type1: Add support for manual dirty log clear") Signed-off-by: Jiacheng Shi billsjc@sjtu.edu.cn
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 5daceec48811..6811a85109aa 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -1150,7 +1150,7 @@ static int vfio_iova_dirty_log_clear(u64 __user *bitmap, }
out:
- kfree(bitmap_buffer);
- kvfree(bitmap_buffer); return ret;
}
.
.
Acked-by: Xie XiuQi xiexiuqi@huawei.com
On 2021/12/13 19:45, Keqian Zhu wrote:
Hi Jiacheng,
Reviewed-by: Keqian Zhu zhukeqian1@huawei.com
这是一个有效补丁,good job!
ps:后续补丁可以抄送一下相关maintainer和原补丁作者,可以让你的补丁得到更快响应。
Thanks, Keqian
On 2021/12/13 11:48, Jiacheng Shi wrote:
Variables allocated by kvmalloc should not be freed by kfree. Because they may be allocated by vmalloc. So we replace kfree with kvfree here.
Fixes: 738fe155f58b ("vfio/iommu_type1: Add support for manual dirty log clear") Signed-off-by: Jiacheng Shi billsjc@sjtu.edu.cn
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 5daceec48811..6811a85109aa 100644 --- a/drivers/vfio/vfio_iommu_type1.c +++ b/drivers/vfio/vfio_iommu_type1.c @@ -1150,7 +1150,7 @@ static int vfio_iova_dirty_log_clear(u64 __user *bitmap, }
out:
- kfree(bitmap_buffer);
- kvfree(bitmap_buffer); return ret;
}
.