Commit d1a08460 authored by Kangjie Lu's avatar Kangjie Lu Committed by James Morris

security: inode: fix a missing check for securityfs_create_file

securityfs_create_file  may fail. The fix checks its status and
returns the error code upstream if it fails.
Signed-off-by: default avatarKangjie Lu <kjlu@umn.edu>
Signed-off-by: default avatarJames Morris <james.morris@microsoft.com>
parent 0b9dc6c9
......@@ -339,6 +339,11 @@ 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;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment