In btrfs_create_tree(), if btrfs_insert_root() fails, we should
free root->commit_root.

Reported-by: Alex Lyakas <a...@zadarastorage.com>
Signed-off-by: Tsutomu Itoh <t-i...@jp.fujitsu.com>
---
 fs/btrfs/disk-io.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 6d1ac7d..a35d7fb 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -1374,6 +1374,7 @@ struct btrfs_root *btrfs_create_tree(struct 
btrfs_trans_handle *trans,
 fail:
        if (leaf) {
                btrfs_tree_unlock(leaf);
+               free_extent_buffer(root->commit_root);
                free_extent_buffer(leaf);
        }
        kfree(root);
-- 
1.8.5.5

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to