mirror of
https://github.com/FEX-Emu/linux.git
synced 2024-12-15 05:11:32 +00:00
btrfs: free ulist in qgroup_shared_accounting() error path
If tmp = ulist_alloc(GFP_NOFS) fails, we return without freeing the previously allocated qgroups = ulist_alloc(GFP_NOFS) and cause a memory leak. Signed-off-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Chris Mason <clm@fb.com>
This commit is contained in:
parent
b050f9f6dd
commit
d737278091
@ -1798,8 +1798,10 @@ static int qgroup_shared_accounting(struct btrfs_trans_handle *trans,
|
||||
return -ENOMEM;
|
||||
|
||||
tmp = ulist_alloc(GFP_NOFS);
|
||||
if (!tmp)
|
||||
if (!tmp) {
|
||||
ulist_free(qgroups);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
btrfs_get_tree_mod_seq(fs_info, &elem);
|
||||
ret = btrfs_find_all_roots(trans, fs_info, oper->bytenr, elem.seq,
|
||||
|
Loading…
Reference in New Issue
Block a user