Skip to contentSkip to conversation

Btrfs: fix fspath error deallocation

PATCH In review Vincent Stehlé 2 participants 2 messages May 10, 2016 Btrfs file system

lore
Share & tools
lore
#0 lore raw

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").

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
index 80e8472..d309018 100644
@@ -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
Reviewed-by on v1 1/1
#1 lore raw
Quoted 11 lines · Vincent Stehlé

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").

Cc Chris Mason <[email protected]>
Cc Josef Bacik <[email protected]>
Cc David Sterba <[email protected]>