summaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorLiu Bo <bo.li.liu@oracle.com>2016-09-14 05:02:27 +0300
committerDavid Sterba <dsterba@suse.com>2016-09-26 20:37:06 +0300
commita958eab0ed7fdc1b977bc25d3af6efedaa945488 (patch)
treedbb8ced3615f54c919f3bd80cc12fb96517c97a2 /fs/btrfs
parentc01f5f96f511419ee656a60e09605b7b6a63b66c (diff)
downloadlinux-a958eab0ed7fdc1b977bc25d3af6efedaa945488.tar.xz
Btrfs: fix memory leak in do_walk_down
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>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/extent-tree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 56d8ec21a0f4..e229d740bdfe 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -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;
}