Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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 <t-itoh@jp.fujitsu.com>
Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parent 91ca338d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1153,6 +1153,7 @@ struct btrfs_root *btrfs_read_fs_root_no_radix(struct btrfs_root *tree_root,
	}
	btrfs_free_path(path);
	if (ret) {
		kfree(root);
		if (ret > 0)
			ret = -ENOENT;
		return ERR_PTR(ret);