diff mbox series

[-next] lsm: Use IS_ERR_OR_NULL() helper function

Message ID 20240828122450.3697314-1-lihongbo22@huawei.com (mailing list archive)
State Accepted
Delegated to: Paul Moore
Headers show
Series [-next] lsm: Use IS_ERR_OR_NULL() helper function | expand

Commit Message

Hongbo Li Aug. 28, 2024, 12:24 p.m. UTC
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>
---
 security/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Paul Moore Aug. 29, 2024, 3:12 p.m. UTC | #1
On Aug 28, 2024 Hongbo Li <lihongbo22@huawei.com> wrote:
> 
> 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>
> ---
>  security/inode.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Merged into lsm/dev, thanks.

--
paul-moore.com
diff mbox series

Patch

diff --git a/security/inode.c b/security/inode.c
index f21847badb7d..da3ab44c8e57 100644
--- a/security/inode.c
+++ b/security/inode.c
@@ -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);