mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
Btrfs: fix possible memory leak in find_parent_nodes()
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com> Reviewed-by: Miao Xie <miaox@cn.fujitsu.com> Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
parent
09fb99a696
commit
a4fdb61e81
1 changed files with 1 additions and 1 deletions
|
@ -911,7 +911,6 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
|
|||
|
||||
while (!list_empty(&prefs)) {
|
||||
ref = list_first_entry(&prefs, struct __prelim_ref, list);
|
||||
list_del(&ref->list);
|
||||
WARN_ON(ref->count < 0);
|
||||
if (ref->count && ref->root_id && ref->parent == 0) {
|
||||
/* no parent == root of tree */
|
||||
|
@ -956,6 +955,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
|
|||
eie->next = ref->inode_list;
|
||||
}
|
||||
}
|
||||
list_del(&ref->list);
|
||||
kfree(ref);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue