Commit 5e540f77 authored by Tsutomu Itoh's avatar Tsutomu Itoh Committed by Chris Mason
Browse files

btrfs: Fix memory leak in btrfs_read_fs_root_no_radix()

In btrfs_read_fs_root_no_radix(), 'root' is not freed if
btrfs_search_slot() returns error.
Signed-off-by: default avatarTsutomu Itoh <>
Signed-off-by: default avatarChris Mason <>
parent 91ca338d
...@@ -1153,6 +1153,7 @@ struct btrfs_root *btrfs_read_fs_root_no_radix(struct btrfs_root *tree_root, ...@@ -1153,6 +1153,7 @@ struct btrfs_root *btrfs_read_fs_root_no_radix(struct btrfs_root *tree_root,
} }
btrfs_free_path(path); btrfs_free_path(path);
if (ret) { if (ret) {
if (ret > 0) if (ret > 0)
ret = -ENOENT; ret = -ENOENT;
return ERR_PTR(ret); return ERR_PTR(ret);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment