[PATCH] btrfs: Fix memory leak in btrfs_read_fs_root_no_radix()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In btrfs_read_fs_root_no_radix(), 'root' is not freed if
btrfs_search_slot() returns error.

Signed-off-by: Tsutomu Itoh <t-itoh@xxxxxxxxxxxxxx>
---
 disk-io.c |    1 +
 1 file changed, 1 insertion(+)

diff -urNp linux-2.6.37-rc7/fs/btrfs/disk-io.c linux-2.6.37-rc7.new/fs/btrfs/disk-io.c
--- linux-2.6.37-rc7/fs/btrfs/disk-io.c 2010-12-22 04:26:40.000000000 +0900
+++ linux-2.6.37-rc7.new/fs/btrfs/disk-io.c     2010-12-27 15:21:19.000000000 +0900
@@ -1145,6 +1145,7 @@ struct btrfs_root *btrfs_read_fs_root_no
 	}
 	btrfs_free_path(path);
 	if (ret) {
+		kfree(root);
 		if (ret > 0)
 			ret = -ENOENT;
 		return ERR_PTR(ret);


--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux