Skip to content

Commit abe3bf7

Browse files
tititiou36kdave
authored andcommitted
btrfs: fix an error handling path in btrfs_rename()
If new_whiteout_inode() fails, some resources need to be freed. Add the missing goto to the error handling path. Fixes: ab3c5c1 ("btrfs: setup qstr from dentrys using fscrypt helper") Reviewed-by: Sweet Tea Dorminy <[email protected]> Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: David Sterba <[email protected]> Signed-off-by: David Sterba <[email protected]>
1 parent b7af063 commit abe3bf7

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

fs/btrfs/inode.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9377,8 +9377,10 @@ static int btrfs_rename(struct user_namespace *mnt_userns,
93779377

93789378
if (flags & RENAME_WHITEOUT) {
93799379
whiteout_args.inode = new_whiteout_inode(mnt_userns, old_dir);
9380-
if (!whiteout_args.inode)
9381-
return -ENOMEM;
9380+
if (!whiteout_args.inode) {
9381+
ret = -ENOMEM;
9382+
goto out_fscrypt_names;
9383+
}
93829384
ret = btrfs_new_inode_prepare(&whiteout_args, &trans_num_items);
93839385
if (ret)
93849386
goto out_whiteout_inode;

0 commit comments

Comments
 (0)