From: Matthew Garrett <matthewgarrett@google.com>
To: jmorris@namei.org
Cc: linux-security-module@vger.kernel.org,
kbuild test robot <lkp@intel.com>,
Matthew Garrett <matthewgarrett@google.com>
Subject: [PATCH 4/6] security: fix ptr_ret.cocci warnings
Date: Tue, 13 Aug 2019 12:21:24 -0700 [thread overview]
Message-ID: <20190813192126.122370-5-matthewgarrett@google.com> (raw)
In-Reply-To: <20190813192126.122370-1-matthewgarrett@google.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")
Signed-off-by: kbuild test robot <lkp@intel.com>
Signed-off-by: Matthew Garrett <matthewgarrett@google.com>
---
security/lockdown/lockdown.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/security/lockdown/lockdown.c b/security/lockdown/lockdown.c
index f6c74cf6a798..0068cec77c05 100644
--- a/security/lockdown/lockdown.c
+++ b/security/lockdown/lockdown.c
@@ -176,10 +176,7 @@ static int __init lockdown_secfs_init(void)
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);
--
2.23.0.rc1.153.gdeed80330f-goog
next prev parent reply other threads:[~2019-08-13 19:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-13 19:21 [PATCH 0/6] lockdown fixups Matthew Garrett
2019-08-13 19:21 ` [PATCH 1/6] tracefs: Fix potential null dereference in default_file_open() Matthew Garrett
2019-08-13 19:21 ` [PATCH 2/6] early_security_init() needs a stub got !CONFIG_SECURITY Matthew Garrett
2019-08-13 19:21 ` [PATCH 3/6] Avoid build warning when !CONFIG_KEXEC_SIG Matthew Garrett
2019-08-14 5:23 ` Dave Young
2019-08-14 17:18 ` Matthew Garrett
2019-08-13 19:21 ` Matthew Garrett [this message]
2019-08-13 19:21 ` [PATCH 5/6] kexec: s/KEXEC_VERIFY_SIG/KEXEC_SIG/ for consistency Matthew Garrett
2019-08-13 19:21 ` [PATCH 6/6] Document locked_down LSM hook Matthew Garrett
2019-08-13 22:59 ` [PATCH 0/6] lockdown fixups James Morris
2019-08-14 5:06 ` James Morris
2019-08-14 17:20 ` Matthew Garrett
2019-08-14 18:24 ` James Morris
2019-08-14 18:26 ` Matthew Garrett
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=20190813192126.122370-5-matthewgarrett@google.com \
--to=matthewgarrett@google.com \
--cc=jmorris@namei.org \
--cc=linux-security-module@vger.kernel.org \
--cc=lkp@intel.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).