summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/disk-io.c
diff options
context:
space:
mode:
authorTsutomu Itoh <t-itoh@jp.fujitsu.com>2010-12-27 06:53:10 +0000
committerChris Mason <chris.mason@oracle.com>2011-01-16 11:30:20 -0500
commit5e540f7715b8cd83b8e60beaaa525b125cc122de (patch)
tree93ce1b3e22354c8d8e477ee56b925a44e7b9713e /fs/btrfs/disk-io.c
parent91ca338d776e0cefb255bf2979b6448febd880f5 (diff)
downloadtalos-obmc-linux-5e540f7715b8cd83b8e60beaaa525b125cc122de.tar.gz
talos-obmc-linux-5e540f7715b8cd83b8e60beaaa525b125cc122de.zip
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 <t-itoh@jp.fujitsu.com> Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/disk-io.c')
-rw-r--r--fs/btrfs/disk-io.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index a0c37b2ee9ed..9b1dd4138072 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);
OpenPOWER on IntegriCloud