From: Kees Cook <keescook@chromium.org>
To: kbuild test robot <lkp@intel.com>
Cc: Matthew Garrett <matthewgarrett@google.com>,
kbuild-all@01.org, linux-security-module@vger.kernel.org,
James Morris <jmorris@namei.org>
Subject: Re: [PATCH] security: fix ptr_ret.cocci warnings
Date: Mon, 12 Aug 2019 11:00:58 -0700 [thread overview]
Message-ID: <201908121100.B6A6F390@keescook> (raw)
In-Reply-To: <20190810065846.6giywcprz47xbwij@48261080c7f1>
On Sat, Aug 10, 2019 at 02:58:46PM +0800, kbuild test robot wrote:
> From: kbuild test robot <lkp@intel.com>
>
> security/lockdown/lockdown.c:157:1-3: WARNING: PTR_ERR_OR_ZERO can be used
>
>
> Use PTR_ERR_OR_ZERO rather than if(IS_ERR(...)) + PTR_ERR
>
> Generated by: scripts/coccinelle/api/ptr_ret.cocci
>
> Fixes: 80d14015a8e3 ("security: Add a static lockdown policy LSM")
> CC: Matthew Garrett <matthewgarrett@google.com>
> Signed-off-by: kbuild test robot <lkp@intel.com>
Acked-by: Kees Cook <keescook@chromium.org>
-Kees
> ---
>
> tree: https://kernel.googlesource.com/pub/scm/linux/kernel/git/jmorris/linux-security.git next-lockdown
> head: 05ef41e93e1a40d6b2d9846284824ec6f67fe422
> commit: 80d14015a8e3109f9b5e3e39b0bc78e1c3a1f315 [3/29] security: Add a static lockdown policy LSM
>
> lockdown.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> --- a/security/lockdown/lockdown.c
> +++ b/security/lockdown/lockdown.c
> @@ -154,10 +154,7 @@ static int __init lockdown_secfs_init(vo
>
> dentry = securityfs_create_file("lockdown", 0600, NULL, NULL,
> &lockdown_ops);
> - if (IS_ERR(dentry))
> - return PTR_ERR(dentry);
> -
> - return 0;
> + return PTR_ERR_OR_ZERO(dentry);
> }
>
> core_initcall(lockdown_secfs_init);
--
Kees Cook
prev parent reply other threads:[~2019-08-12 18:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-10 6:58 [security:next-lockdown 3/29] security/lockdown/lockdown.c:157:1-3: WARNING: PTR_ERR_OR_ZERO can be used kbuild test robot
2019-08-10 6:58 ` [PATCH] security: fix ptr_ret.cocci warnings kbuild test robot
2019-08-12 18:00 ` Kees Cook [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=201908121100.B6A6F390@keescook \
--to=keescook@chromium.org \
--cc=jmorris@namei.org \
--cc=kbuild-all@01.org \
--cc=linux-security-module@vger.kernel.org \
--cc=lkp@intel.com \
--cc=matthewgarrett@google.com \
/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;
as well as URLs for NNTP newsgroup(s).