Skip to content

Commit 121affd

Browse files
KatrinJoamschuma-ntap
authored andcommitted
nfs: Remove redundant null checks before kfree
Fix the following coccicheck warning: fs/nfs/dir.c:2494:2-7: WARNING: NULL check before some freeing functions is not needed. Signed-off-by: Yushan Zhou <[email protected]> Signed-off-by: Anna Schumaker <[email protected]>
1 parent 247f34f commit 121affd

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

fs/nfs/dir.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2489,9 +2489,8 @@ int nfs_unlink(struct inode *dir, struct dentry *dentry)
24892489
spin_unlock(&dentry->d_lock);
24902490
goto out;
24912491
}
2492-
if (dentry->d_fsdata)
2493-
/* old devname */
2494-
kfree(dentry->d_fsdata);
2492+
/* old devname */
2493+
kfree(dentry->d_fsdata);
24952494
dentry->d_fsdata = NFS_FSDATA_BLOCKED;
24962495

24972496
spin_unlock(&dentry->d_lock);

0 commit comments

Comments
 (0)