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

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

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
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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;
}