Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fe9fd2ef authored by James Morris's avatar James Morris
Browse files

Revert "security: inode: fix a missing check for securityfs_create_file"



This reverts commit d1a08460.

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: default avatarJames Morris <james.morris@microsoft.com>
parent ecb8e74d
Loading
Loading
Loading
Loading
+0 −5
Original line number Original line Diff line number Diff line
@@ -339,11 +339,6 @@ static int __init securityfs_init(void)
#ifdef CONFIG_SECURITY
#ifdef CONFIG_SECURITY
	lsm_dentry = securityfs_create_file("lsm", 0444, NULL, NULL,
	lsm_dentry = securityfs_create_file("lsm", 0444, NULL, NULL,
						&lsm_ops);
						&lsm_ops);
	if (IS_ERR(lsm_dentry)) {
		unregister_filesystem(&fs_type);
		sysfs_remove_mount_point(kernel_kobj, "security");
		return PTR_ERR(lsm_dentry);
	}
#endif
#endif
	return 0;
	return 0;
}
}