xfs: use kvfree for buf in xfs_ioc_getbmap
PATCH 1/1 xfs: use kvfree for buf in xfs_ioc_getbmap
Without this the kernel crashes in kfree for files with a sufficiently large number of extents.
Fixes d4c75a1b40cd ("xfs: convert remaining kmem_free() to kfree()")
Signed-off-by Christoph Hellwig <[email protected]>
--- fs/xfs/xfs_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/xfs/xfs_ioctl.c +1 -1
@@ -1506,7 +1506,7 @@ xfs_ioc_getbmap( error =0 ; out_free_buf: -kfree (buf); +kvfree (buf);return error; }
Signature · 1 line
2.39.2
Quoted 5 lines · Christoph Hellwig
Without this the kernel crashes in kfree for files with a sufficiently large number of extents.
Fixes d4c75a1b40cd ("xfs: convert remaining kmem_free() to kfree()")Signed-off-by Christoph Hellwig <[email protected]>
LGTM:
Reviewed-by Carlos Maiolino <[email protected]>
Quoted 21 lines
--- fs/xfs/xfs_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/xfs/xfs_ioctl.c +1
-2@@ -1506,7 +1506,7 @@ xfs_ioc_getbmap( error =0 ; out_free_buf: -kfree (buf); +kvfree (buf);return error; } --2.39.2
Quoted 6 lines · Christoph Hellwig
Without this the kernel crashes in kfree for files with a sufficiently large number of extents.
Fixes d4c75a1b40cd ("xfs: convert remaining kmem_free() to kfree()")Signed-off-by Christoph Hellwig <[email protected]>---
Commit d4c75a1b40cd uses sed in-place replace to change kmem_free ->kfree. xfs_ioc_getbmap() allocates buffer using kvcalloc().
Looks good.
Reviewed-by Chaitanya Kulkarni <[email protected]>
-ck