Btrfs: fix memory leak in do_walk_down
authorLiu Bo <bo.li.liu@oracle.com>
Wed, 14 Sep 2016 02:02:27 +0000 (19:02 -0700)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Sep 2016 17:37:06 +0000 (19:37 +0200)
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>
fs/btrfs/extent-tree.c

index 56d8ec21a0f4f2838353fca8cd3107a000818330..e229d740bdfe32b159aad3582dbd71fee794fc5e 100644 (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;
        }