Linux Security Modules development
 help / color / mirror / Atom feed
From: serge@hallyn.com (Serge E. Hallyn)
To: linux-security-module@vger.kernel.org
Subject: [PATCH -next] integrity: fix the error return code in integrity_load_keys()
Date: Mon, 28 May 2018 00:17:17 -0500	[thread overview]
Message-ID: <20180528051717.GA11155@mail.hallyn.com> (raw)
In-Reply-To: <1527473316-35602-1-git-send-email-weiyongjun1@huawei.com>

On Mon, May 28, 2018 at 02:08:36AM +0000, Wei Yongjun wrote:
> The error return code PTR_ERR(integrity_dir) is always 0 since
> integrity_dir is set to NULL in this error handling case.
> 
> Fixes: 0c343af8065b ("integrity: Add an integrity directory in securityfs")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>

Huh.

Acked-by: Serge Hallyn <serge@hallyn.com>

> ---
>  security/integrity/iint.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/security/integrity/iint.c b/security/integrity/iint.c
> index 149faa8..2dfc9e8 100644
> --- a/security/integrity/iint.c
> +++ b/security/integrity/iint.c
> @@ -217,12 +217,15 @@ void __init integrity_load_keys(void)
>  
>  static int __init integrity_fs_init(void)
>  {
> +	int ret;
> +
>  	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));
> +		ret = PTR_ERR(integrity_dir);
>  		integrity_dir = NULL;
> -		return PTR_ERR(integrity_dir);
> +		return ret;
>  	}
>  
>  	return 0;
--
To unsubscribe from this list: send the line "unsubscribe linux-security-module" in
the body of a message to majordomo at vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2018-05-28  5:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-28  2:08 [PATCH -next] integrity: fix the error return code in integrity_load_keys() Wei Yongjun
2018-05-28  5:17 ` Serge E. Hallyn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180528051717.GA11155@mail.hallyn.com \
    --to=serge@hallyn.com \
    --cc=linux-security-module@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox