Btrfs: fix memory leak in do_walk_down

The extent buffer 'next' needs to be free'd conditionally.

Signed-off-by: Liu Bo <[email protected]>
Reviewed-by: David Sterba <[email protected]>
Signed-off-by: David Sterba <[email protected]>
This commit is contained in:
Liu Bo 2016-09-13 19:02:27 -07:00 • committed by David Sterba
commit a958eab0ed

View file

@ -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;
}