diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-17 21:29:13 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-03-20 21:29:49 -0400 |
commit | 0794f569ec307dc25bbb12456ef75aa71f72f744 (patch) | |
tree | 3b3d090c3ca8cdf64cff3531ac4b855f7ebee592 /fs/ecryptfs/main.c | |
parent | f4c5499d2cbe54f0470764acfd0faf4e965aa7e9 (diff) |
ecryptfs: make register_filesystem() the last potential failure exit
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/ecryptfs/main.c')
-rw-r--r-- | fs/ecryptfs/main.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c index 6e0e017e6932..68954937a071 100644 --- a/fs/ecryptfs/main.c +++ b/fs/ecryptfs/main.c | |||
@@ -794,15 +794,10 @@ static int __init ecryptfs_init(void) | |||
794 | "Failed to allocate one or more kmem_cache objects\n"); | 794 | "Failed to allocate one or more kmem_cache objects\n"); |
795 | goto out; | 795 | goto out; |
796 | } | 796 | } |
797 | rc = register_filesystem(&ecryptfs_fs_type); | ||
798 | if (rc) { | ||
799 | printk(KERN_ERR "Failed to register filesystem\n"); | ||
800 | goto out_free_kmem_caches; | ||
801 | } | ||
802 | rc = do_sysfs_registration(); | 797 | rc = do_sysfs_registration(); |
803 | if (rc) { | 798 | if (rc) { |
804 | printk(KERN_ERR "sysfs registration failed\n"); | 799 | printk(KERN_ERR "sysfs registration failed\n"); |
805 | goto out_unregister_filesystem; | 800 | goto out_free_kmem_caches; |
806 | } | 801 | } |
807 | rc = ecryptfs_init_kthread(); | 802 | rc = ecryptfs_init_kthread(); |
808 | if (rc) { | 803 | if (rc) { |
@@ -823,19 +818,24 @@ static int __init ecryptfs_init(void) | |||
823 | "rc = [%d]\n", rc); | 818 | "rc = [%d]\n", rc); |
824 | goto out_release_messaging; | 819 | goto out_release_messaging; |
825 | } | 820 | } |
821 | rc = register_filesystem(&ecryptfs_fs_type); | ||
822 | if (rc) { | ||
823 | printk(KERN_ERR "Failed to register filesystem\n"); | ||
824 | goto out_destroy_crypto; | ||
825 | } | ||
826 | if (ecryptfs_verbosity > 0) | 826 | if (ecryptfs_verbosity > 0) |
827 | printk(KERN_CRIT "eCryptfs verbosity set to %d. Secret values " | 827 | printk(KERN_CRIT "eCryptfs verbosity set to %d. Secret values " |
828 | "will be written to the syslog!\n", ecryptfs_verbosity); | 828 | "will be written to the syslog!\n", ecryptfs_verbosity); |
829 | 829 | ||
830 | goto out; | 830 | goto out; |
831 | out_destroy_crypto: | ||
832 | ecryptfs_destroy_crypto(); | ||
831 | out_release_messaging: | 833 | out_release_messaging: |
832 | ecryptfs_release_messaging(); | 834 | ecryptfs_release_messaging(); |
833 | out_destroy_kthread: | 835 | out_destroy_kthread: |
834 | ecryptfs_destroy_kthread(); | 836 | ecryptfs_destroy_kthread(); |
835 | out_do_sysfs_unregistration: | 837 | out_do_sysfs_unregistration: |
836 | do_sysfs_unregistration(); | 838 | do_sysfs_unregistration(); |
837 | out_unregister_filesystem: | ||
838 | unregister_filesystem(&ecryptfs_fs_type); | ||
839 | out_free_kmem_caches: | 839 | out_free_kmem_caches: |
840 | ecryptfs_free_kmem_caches(); | 840 | ecryptfs_free_kmem_caches(); |
841 | out: | 841 | out: |