[PATCH 20/61] apparmor: Prefer IS_ERR_OR_NULL over manual NULL check
Philipp Hahn
phahn-oss at avm.de
Tue Mar 10 04:48:46 PDT 2026
Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.
Change generated with coccinelle.
To: John Johansen <john.johansen at canonical.com>
To: Paul Moore <paul at paul-moore.com>
To: James Morris <jmorris at namei.org>
To: "Serge E. Hallyn" <serge at hallyn.com>
Cc: apparmor at lists.ubuntu.com
Cc: linux-security-module at vger.kernel.org
Cc: linux-kernel at vger.kernel.org
Signed-off-by: Philipp Hahn <phahn-oss at avm.de>
---
security/apparmor/apparmorfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/security/apparmor/apparmorfs.c b/security/apparmor/apparmorfs.c
index 2f84bd23edb69e7e69cb097e554091df0132816d..5145b0c9c699514697291967c5a7b1e96b8753d1 100644
--- a/security/apparmor/apparmorfs.c
+++ b/security/apparmor/apparmorfs.c
@@ -352,7 +352,7 @@ static void aafs_remove(struct dentry *dentry)
{
struct inode *dir;
- if (!dentry || IS_ERR(dentry))
+ if (IS_ERR_OR_NULL(dentry))
return;
/* ->d_parent is stable as rename is not supported */
--
2.43.0
More information about the Linux-rockchip
mailing list