Prefer using IS_ERR_OR_NULL() over using IS_ERR() and a manual NULL
check.

Change generated with coccinelle.

To: John Johansen <[email protected]>
To: Paul Moore <[email protected]>
To: James Morris <[email protected]>
To: "Serge E. Hallyn" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Philipp Hahn <[email protected]>
---
 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


Reply via email to