提交 59885b39 编写于 作者: T Tsutomu Itoh 提交者: Chris Mason

Btrfs: fix possible memory leak in btrfs_create_tree()

In btrfs_create_tree(), if btrfs_insert_root() fails, we should
free root->commit_root.
Reported-by: NAlex Lyakas <alex@zadarastorage.com>
Signed-off-by: NTsutomu Itoh <t-itoh@jp.fujitsu.com>
Signed-off-by: NChris Mason <clm@fb.com>
上级 776e4aae
......@@ -1366,6 +1366,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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册