提交 ac2409a5 编写于 作者: S Sudeep Holla 提交者: Mimi Zohar

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: NSudeep Holla <sudeep.holla@arm.com>
Acked-by: NMatthew Garrett <mjg59@google.com>
Signed-off-by: NMimi Zohar <zohar@linux.vnet.ibm.com>
上级 dba31ee7
...@@ -219,10 +219,13 @@ static int __init integrity_fs_init(void) ...@@ -219,10 +219,13 @@ static int __init integrity_fs_init(void)
{ {
integrity_dir = securityfs_create_dir("integrity", NULL); integrity_dir = securityfs_create_dir("integrity", NULL);
if (IS_ERR(integrity_dir)) { if (IS_ERR(integrity_dir)) {
pr_err("Unable to create integrity sysfs dir: %ld\n", int ret = PTR_ERR(integrity_dir);
PTR_ERR(integrity_dir));
if (ret != -ENODEV)
pr_err("Unable to create integrity sysfs dir: %d\n",
ret);
integrity_dir = NULL; integrity_dir = NULL;
return PTR_ERR(integrity_dir); return ret;
} }
return 0; return 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册