Skip to content

Commit

Permalink
Btrfs: fix possible memory leak in find_parent_nodes()
Browse files Browse the repository at this point in the history
Signed-off-by: Wang Shilong <[email protected]>
Reviewed-by: Miao Xie <[email protected]>
Signed-off-by: Josef Bacik <[email protected]>
Signed-off-by: Chris Mason <[email protected]>
  • Loading branch information
Wang Shilong authored and Chris Mason committed Sep 1, 2013
1 parent 09fb99a commit a4fdb61
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/btrfs/backref.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit a4fdb61

Please sign in to comment.