forked from luck/tmp_suning_uos_patched
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: Kangjie Lu <kjlu@umn.edu> Signed-off-by: James Morris <james.morris@microsoft.com>
This commit is contained in:
parent
0b9dc6c9f0
commit
d1a0846006
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user