aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index 57080dffdfc6..dcd5aef6b614 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -933,8 +933,12 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
933 * then open_ctree will properly initialize everything later. 933 * then open_ctree will properly initialize everything later.
934 */ 934 */
935 fs_info = kzalloc(sizeof(struct btrfs_fs_info), GFP_NOFS); 935 fs_info = kzalloc(sizeof(struct btrfs_fs_info), GFP_NOFS);
936 if (!fs_info) {
937 error = -ENOMEM;
938 goto error_close_devices;
939 }
936 tree_root = kzalloc(sizeof(struct btrfs_root), GFP_NOFS); 940 tree_root = kzalloc(sizeof(struct btrfs_root), GFP_NOFS);
937 if (!fs_info || !tree_root) { 941 if (!tree_root) {
938 error = -ENOMEM; 942 error = -ENOMEM;
939 goto error_close_devices; 943 goto error_close_devices;
940 } 944 }
@@ -964,7 +968,6 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
964 968
965 btrfs_close_devices(fs_devices); 969 btrfs_close_devices(fs_devices);
966 free_fs_info(fs_info); 970 free_fs_info(fs_info);
967 kfree(tree_root);
968 } else { 971 } else {
969 char b[BDEVNAME_SIZE]; 972 char b[BDEVNAME_SIZE];
970 973
@@ -992,7 +995,6 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
992error_close_devices: 995error_close_devices:
993 btrfs_close_devices(fs_devices); 996 btrfs_close_devices(fs_devices);
994 free_fs_info(fs_info); 997 free_fs_info(fs_info);
995 kfree(tree_root);
996 return ERR_PTR(error); 998 return ERR_PTR(error);
997} 999}
998 1000