Btrfs: fix fspath error deallocation
PATCH 1/1 Btrfs: fix fspath error deallocation
Make sure to deallocate fspath with vfree() in case of error in init_ipath().
fspath is allocated with vmalloc() in init_data_container() since commit 425d17a290c0 ("Btrfs: use larger limit for translation of logical to inode").
Signed-off-by Vincent Stehlé <[email protected]>
Cc Chris Mason <[email protected]>
Cc Josef Bacik <[email protected]>
Cc David Sterba <[email protected]>
--- fs/btrfs/backref.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/btrfs/backref.c +1 -1
@@ -1991,7 +1991,7 @@ struct inode_fs_paths *init_ipath(s32 total_bytes, struct btrfs_root *fs_root, ifp =kmalloc (sizeof (*ifp),GFP_NOFS );if (!ifp) { -kfree (fspath); +vfree (fspath);return ERR_PTR (-ENOMEM ); }
Signature · 1 line
2.8.0.rc3
Quoted 11 lines · Vincent Stehlé
Make sure to deallocate fspath with
vfree()in case of error ininit_ipath().fspath is allocated with
vmalloc()ininit_data_container()since commit425d17a290c0("Btrfs: use larger limit for translation of logical to inode").Signed-off-by Vincent Stehlé <[email protected]>Cc Chris Mason <[email protected]>Cc Josef Bacik <[email protected]>Cc David Sterba <[email protected]>
Reviewed-by David Sterba <[email protected]>