aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/super.c
diff options
context:
space:
mode:
authorWyatt Banks <wyatt@banksresearch.com>2007-11-19 10:22:33 -0500
committerChris Mason <chris.mason@oracle.com>2008-09-25 11:03:58 -0400
commit2f4cbe6442d3be7b5e4cf1607a5ab33995fe2d25 (patch)
treea2c1554296d2d8252fb1748dd06c589572e5be54 /fs/btrfs/super.c
parent3acd7ee876c508973eb4722de5b00b3dff4c7372 (diff)
Btrfs: Return value checking in module init
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Diffstat (limited to 'fs/btrfs/super.c')
-rw-r--r--fs/btrfs/super.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c
index c46bc391179..ffa02872c4d 100644
--- a/fs/btrfs/super.c
+++ b/fs/btrfs/super.c
@@ -347,9 +347,24 @@ static int __init init_btrfs_fs(void)
btrfs_init_transaction_sys();
err = btrfs_init_cachep();
if (err)
- return err;
- extent_map_init();
- return register_filesystem(&btrfs_fs_type);
+ goto free_transaction_sys;
+ err = extent_map_init();
+ if (err)
+ goto free_cachep;
+
+ err = register_filesystem(&btrfs_fs_type);
+ if (err)
+ goto free_extent_map;
+ return 0;
+
+free_extent_map:
+ extent_map_exit();
+free_cachep:
+ btrfs_destroy_cachep();
+free_transaction_sys:
+ btrfs_exit_transaction_sys();
+ btrfs_exit_sysfs();
+ return err;
}
static void __exit exit_btrfs_fs(void)