From: Tsutomu Itoh Date: Mon, 27 Dec 2010 06:53:10 +0000 (+0000) Subject: btrfs: Fix memory leak in btrfs_read_fs_root_no_radix() X-Git-Tag: v2.6.38-rc1~14^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5e540f7715b8cd83b8e60beaaa525b125cc122de;p=platform%2Fkernel%2Flinux-exynos.git 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: Tsutomu Itoh Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c index a0c37b2..9b1dd41 100644 --- a/fs/btrfs/disk-io.c +++ b/fs/btrfs/disk-io.c @@ -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);