Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ecryptfs: make register_filesystem() the last potential failure exit

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 0794f569 f4c5499d

+8 -8
+8 -8
fs/ecryptfs/main.c
··· 794 794 "Failed to allocate one or more kmem_cache objects\n"); 795 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 797 rc = do_sysfs_registration(); 803 798 if (rc) { 804 799 printk(KERN_ERR "sysfs registration failed\n"); 805 - goto out_unregister_filesystem; 800 + goto out_free_kmem_caches; 806 801 } 807 802 rc = ecryptfs_init_kthread(); 808 803 if (rc) { ··· 818 823 "rc = [%d]\n", rc); 819 824 goto out_release_messaging; 820 825 } 826 + rc = register_filesystem(&ecryptfs_fs_type); 827 + if (rc) { 828 + printk(KERN_ERR "Failed to register filesystem\n"); 829 + goto out_destroy_crypto; 830 + } 821 831 if (ecryptfs_verbosity > 0) 822 832 printk(KERN_CRIT "eCryptfs verbosity set to %d. Secret values " 823 833 "will be written to the syslog!\n", ecryptfs_verbosity); 824 834 825 835 goto out; 836 + out_destroy_crypto: 837 + ecryptfs_destroy_crypto(); 826 838 out_release_messaging: 827 839 ecryptfs_release_messaging(); 828 840 out_destroy_kthread: 829 841 ecryptfs_destroy_kthread(); 830 842 out_do_sysfs_unregistration: 831 843 do_sysfs_unregistration(); 832 - out_unregister_filesystem: 833 - unregister_filesystem(&ecryptfs_fs_type); 834 844 out_free_kmem_caches: 835 845 ecryptfs_free_kmem_caches(); 836 846 out: