]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
sanitize coda_dentry_delete()
authorAl Viro <viro@zeniv.linux.org.uk>
Sun, 1 Feb 2026 17:18:30 +0000 (12:18 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Sun, 5 Apr 2026 01:03:13 +0000 (21:03 -0400)
d_really_is_negative(dentry) is a check for d_inode(dentry) being NULL;
rechecking that is pointless (and no, it can't race - the caller is holding
->d_lock, so ->d_inode is stable)

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/coda/dir.c

index 799c3d3ea12c2f3d284b931e53936ca12a43c5e2..2a5048bab6357bc620058c5b90c13708d56ad92a 100644 (file)
@@ -479,18 +479,12 @@ out:
  */
 static int coda_dentry_delete(const struct dentry * dentry)
 {
-       struct inode *inode;
-       struct coda_inode_info *cii;
-
-       if (d_really_is_negative(dentry)) 
-               return 0;
+       struct inode *inode = d_inode(dentry);
 
-       inode = d_inode(dentry);
        if (!inode)
-               return 1;
+               return 0;
 
-       cii = ITOC(inode);
-       if (cii->c_flags & C_PURGE)
+       if (ITOC(inode)->c_flags & C_PURGE)
                return 1;
 
        return 0;