Thread (3 messages) 3 messages, 2 authors, 2019-08-12
STALE2482d

[PATCH] security: fix ptr_ret.cocci warnings

From: kbuild test robot <hidden>
Date: 2019-08-10 06:59:18

From: kbuild test robot <redacted>

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 <redacted>
Signed-off-by: kbuild test robot <redacted>
---

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);
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help