linux-security-module.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Matthew Garrett <matthewgarrett@google.com>
Cc: kbuild-all@01.org, linux-security-module@vger.kernel.org,
	James Morris <jmorris@namei.org>,
	Kees Cook <keescook@chromium.org>
Subject: [PATCH] security: fix ptr_ret.cocci warnings
Date: Sat, 10 Aug 2019 14:58:46 +0800	[thread overview]
Message-ID: <20190810065846.6giywcprz47xbwij@48261080c7f1> (raw)
In-Reply-To: <201908101444.zkWryFiG%lkp@intel.com>

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>
---

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);

  reply	other threads:[~2019-08-10  6:59 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 ` kbuild test robot [this message]
2019-08-12 18:00   ` [PATCH] security: fix ptr_ret.cocci warnings Kees Cook

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=20190810065846.6giywcprz47xbwij@48261080c7f1 \
    --to=lkp@intel.com \
    --cc=jmorris@namei.org \
    --cc=kbuild-all@01.org \
    --cc=keescook@chromium.org \
    --cc=linux-security-module@vger.kernel.org \
    --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).