aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/dir.c
diff options
context:
space:
mode:
authorYushan Zhou <katrinzhou@tencent.com>2022-10-18 12:07:08 +0800
committerAnna Schumaker <Anna.Schumaker@Netapp.com>2022-10-27 15:52:10 -0400
commit121affdf8a940555ceef6ab10a709030e52a4f91 (patch)
treec26492ec3c04bb081589c84b6f9808e710c7ea5b /fs/nfs/dir.c
parentLinux 6.1-rc2 (diff)
downloadlinux-dev-121affdf8a940555ceef6ab10a709030e52a4f91.tar.xz
linux-dev-121affdf8a940555ceef6ab10a709030e52a4f91.zip
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 <katrinzhou@tencent.com> Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Diffstat (limited to 'fs/nfs/dir.c')
-rw-r--r--fs/nfs/dir.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 58036f657126..f594dac436a7 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -2489,9 +2489,8 @@ int nfs_unlink(struct inode *dir, struct dentry *dentry)
spin_unlock(&dentry->d_lock);
goto out;
}
- if (dentry->d_fsdata)
- /* old devname */
- kfree(dentry->d_fsdata);
+ /* old devname */
+ kfree(dentry->d_fsdata);
dentry->d_fsdata = NFS_FSDATA_BLOCKED;
spin_unlock(&dentry->d_lock);