]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
lsm: Use IS_ERR_OR_NULL() helper function
authorHongbo Li <lihongbo22@huawei.com>
Wed, 28 Aug 2024 12:24:50 +0000 (20:24 +0800)
committerPaul Moore <paul@paul-moore.com>
Thu, 29 Aug 2024 15:12:13 +0000 (11:12 -0400)
Use the IS_ERR_OR_NULL() helper instead of open-coding a
NULL and an error pointer checks to simplify the code and
improve readability.

Signed-off-by: Hongbo Li <lihongbo22@huawei.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
security/inode.c

index f21847badb7d8ee8c4e790a363f241b27b29d1c2..da3ab44c8e571f5e1e10fc892ce6883ee924e93f 100644 (file)
@@ -296,7 +296,7 @@ void securityfs_remove(struct dentry *dentry)
 {
        struct inode *dir;
 
-       if (!dentry || IS_ERR(dentry))
+       if (IS_ERR_OR_NULL(dentry))
                return;
 
        dir = d_inode(dentry->d_parent);