Skip to content

Commit

Permalink
Btrfs: fix memory leak in do_walk_down
Browse files Browse the repository at this point in the history
The extent buffer 'next' needs to be free'd conditionally.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
  • Loading branch information
Liu Bo authored and kdave committed Sep 26, 2016
1 parent c01f5f9 commit a958eab
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions fs/btrfs/extent-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -8891,6 +8891,7 @@ static noinline int do_walk_down(struct btrfs_trans_handle *trans,
&wc->flags[level - 1]);
if (ret < 0) {
btrfs_tree_unlock(next);
free_extent_buffer(next);
return ret;
}

Expand Down

0 comments on commit a958eab

Please sign in to comment.