Skip to content

Commit

Permalink
integrity: silence warning when CONFIG_SECURITYFS is not enabled
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sudeep Holla authored and Mimi Zohar committed Jul 18, 2018
1 parent dba31ee commit ac2409a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions security/integrity/iint.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ac2409a

Please sign in to comment.