ecryptfs: make register_filesystem() the last potential failure exit
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
f4c5499d2c
commit
0794f569ec
|
@ -794,15 +794,10 @@ static int __init ecryptfs_init(void)
|
||||||
"Failed to allocate one or more kmem_cache objects\n");
|
"Failed to allocate one or more kmem_cache objects\n");
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
rc = register_filesystem(&ecryptfs_fs_type);
|
|
||||||
if (rc) {
|
|
||||||
printk(KERN_ERR "Failed to register filesystem\n");
|
|
||||||
goto out_free_kmem_caches;
|
|
||||||
}
|
|
||||||
rc = do_sysfs_registration();
|
rc = do_sysfs_registration();
|
||||||
if (rc) {
|
if (rc) {
|
||||||
printk(KERN_ERR "sysfs registration failed\n");
|
printk(KERN_ERR "sysfs registration failed\n");
|
||||||
goto out_unregister_filesystem;
|
goto out_free_kmem_caches;
|
||||||
}
|
}
|
||||||
rc = ecryptfs_init_kthread();
|
rc = ecryptfs_init_kthread();
|
||||||
if (rc) {
|
if (rc) {
|
||||||
|
@ -823,19 +818,24 @@ static int __init ecryptfs_init(void)
|
||||||
"rc = [%d]\n", rc);
|
"rc = [%d]\n", rc);
|
||||||
goto out_release_messaging;
|
goto out_release_messaging;
|
||||||
}
|
}
|
||||||
|
rc = register_filesystem(&ecryptfs_fs_type);
|
||||||
|
if (rc) {
|
||||||
|
printk(KERN_ERR "Failed to register filesystem\n");
|
||||||
|
goto out_destroy_crypto;
|
||||||
|
}
|
||||||
if (ecryptfs_verbosity > 0)
|
if (ecryptfs_verbosity > 0)
|
||||||
printk(KERN_CRIT "eCryptfs verbosity set to %d. Secret values "
|
printk(KERN_CRIT "eCryptfs verbosity set to %d. Secret values "
|
||||||
"will be written to the syslog!\n", ecryptfs_verbosity);
|
"will be written to the syslog!\n", ecryptfs_verbosity);
|
||||||
|
|
||||||
goto out;
|
goto out;
|
||||||
|
out_destroy_crypto:
|
||||||
|
ecryptfs_destroy_crypto();
|
||||||
out_release_messaging:
|
out_release_messaging:
|
||||||
ecryptfs_release_messaging();
|
ecryptfs_release_messaging();
|
||||||
out_destroy_kthread:
|
out_destroy_kthread:
|
||||||
ecryptfs_destroy_kthread();
|
ecryptfs_destroy_kthread();
|
||||||
out_do_sysfs_unregistration:
|
out_do_sysfs_unregistration:
|
||||||
do_sysfs_unregistration();
|
do_sysfs_unregistration();
|
||||||
out_unregister_filesystem:
|
|
||||||
unregister_filesystem(&ecryptfs_fs_type);
|
|
||||||
out_free_kmem_caches:
|
out_free_kmem_caches:
|
||||||
ecryptfs_free_kmem_caches();
|
ecryptfs_free_kmem_caches();
|
||||||
out:
|
out:
|
||||||
|
|
Loading…
Reference in a new issue