xfs: use kvfree for buf in xfs_ioc_getbmap
authorChristoph Hellwig <hch@lst.de>
Fri, 16 Feb 2024 17:02:30 +0000 (18:02 +0100)
committerChandan Babu R <chandanbabu@kernel.org>
Mon, 19 Feb 2024 04:17:31 +0000 (09:47 +0530)
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 <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Chandan Babu R <chandanbabu@kernel.org>
fs/xfs/xfs_ioctl.c

index 7eeebcb6b9250bb85fcb36988951a78a546123fc..7c35d76440972033c6e5210a741e01da3481b02b 100644 (file)
@@ -1506,7 +1506,7 @@ xfs_ioc_getbmap(
 
        error = 0;
 out_free_buf:
-       kfree(buf);
+       kvfree(buf);
        return error;
 }