summaryrefslogtreecommitdiffstats
path: root/security/integrity/iint.c
diff options
context:
space:
mode:
authorSudeep Holla <sudeep.holla@arm.com>2018-06-05 11:25:45 +0100
committerMimi Zohar <zohar@linux.vnet.ibm.com>2018-07-18 07:27:22 -0400
commitac2409a521f7ec5978fd582567398d19f4a2fdbd (patch)
tree11c611f2780e7d717c5adb54cdd3807eaef59e86 /security/integrity/iint.c
parentdba31ee759417ef1a952e929524b0cca1751c036 (diff)
downloadlinux-ac2409a521f7ec5978fd582567398d19f4a2fdbd.tar.bz2
integrity: silence warning when CONFIG_SECURITYFS is not enabled
When CONFIG_SECURITYFS is not enabled, securityfs_create_dir returns -ENODEV which throws the following error: "Unable to create integrity sysfs dir: -19" However, if the feature is disabled, it can't be warning and hence we need to silence the error. This patch checks for the error -ENODEV which is returned when CONFIG_SECURITYFS is disabled to stop the error being thrown. Signed-off-by: Sudeep Holla <sudeep.holla@arm.com> Acked-by: Matthew Garrett <mjg59@google.com> Signed-off-by: Mimi Zohar <zohar@linux.vnet.ibm.com>
Diffstat (limited to 'security/integrity/iint.c')
-rw-r--r--security/integrity/iint.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/security/integrity/iint.c b/security/integrity/iint.c
index 149faa81f6f0..5a6810041e5c 100644
--- a/security/integrity/iint.c
+++ b/security/integrity/iint.c
@@ -219,10 +219,13 @@ static int __init integrity_fs_init(void)
{
integrity_dir = securityfs_create_dir("integrity", NULL);
if (IS_ERR(integrity_dir)) {
- pr_err("Unable to create integrity sysfs dir: %ld\n",
- PTR_ERR(integrity_dir));
+ int ret = PTR_ERR(integrity_dir);
+
+ if (ret != -ENODEV)
+ pr_err("Unable to create integrity sysfs dir: %d\n",
+ ret);
integrity_dir = NULL;
- return PTR_ERR(integrity_dir);
+ return ret;
}
return 0;