From: Yushan Zhou Date: Tue, 18 Oct 2022 04:07:08 +0000 (+0800) Subject: nfs: Remove redundant null checks before kfree X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=121affdf8a940555ceef6ab10a709030e52a4f91;p=linux.git 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 Signed-off-by: Anna Schumaker --- diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c index 58036f6571268..f594dac436a7e 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);