Revert "security: inode: fix a missing check for securityfs_create_file"
authorJames Morris <james.morris@microsoft.com>
Wed, 10 Apr 2019 21:59:20 +0000 (14:59 -0700)
committerJames Morris <james.morris@microsoft.com>
Wed, 10 Apr 2019 21:59:20 +0000 (14:59 -0700)
This reverts commit d1a0846006e4325cc951ca0b05c02ed1d0865006.

From Al Viro:

"Rather bad way to do it - generally, register_filesystem() should be
the last thing done by initialization.  Any modular code that
does unregister_filesystem() on failure exit is flat-out broken;
here it's not instantly FUBAR, but it's a bloody bad example.

What's more, why not let simple_fill_super() do it?  Just
static int fill_super(struct super_block *sb, void *data, int silent)
{
        static const struct tree_descr files[] = {
                {"lsm", &lsm_ops, 0444},
                {""}
        };

and to hell with that call of securityfs_create_file() and all its
failure handling..."

Signed-off-by: James Morris <james.morris@microsoft.com>
security/inode.c

index 667f8b15027d890a60840ab34768f049638d11b2..b7772a9b315eea144fd24afef873b7e54519d7f9 100644 (file)
@@ -339,11 +339,6 @@ static int __init securityfs_init(void)
 #ifdef CONFIG_SECURITY
        lsm_dentry = securityfs_create_file("lsm", 0444, NULL, NULL,
                                                &lsm_ops);
-       if (IS_ERR(lsm_dentry)) {
-               unregister_filesystem(&fs_type);
-               sysfs_remove_mount_point(kernel_kobj, "security");
-               return PTR_ERR(lsm_dentry);
-       }
 #endif
        return 0;
 }