2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00

nfs: remove kfree() redundant null checks

smatch analysis:

fs/nfs/getroot.c:130 nfs_get_root() info: redundant null
 check on name calling kfree()

fs/nfs/unlink.c:272 nfs_async_unlink() info: redundant null
 check on devname_garbage calling kfree()

Cc: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: linux-nfs@vger.kernel.org
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
Tim Gardner 2013-02-12 13:03:42 -07:00 committed by Trond Myklebust
parent 085b7a45c6
commit 96aa1549af
2 changed files with 2 additions and 4 deletions

View File

@ -126,7 +126,6 @@ struct dentry *nfs_get_root(struct super_block *sb, struct nfs_fh *mntfh,
} }
spin_unlock(&ret->d_lock); spin_unlock(&ret->d_lock);
out: out:
if (name)
kfree(name); kfree(name);
nfs_free_fattr(fsinfo.fattr); nfs_free_fattr(fsinfo.fattr);
return ret; return ret;

View File

@ -268,7 +268,6 @@ nfs_async_unlink(struct inode *dir, struct dentry *dentry)
* point dentry is definitely not a root, so we won't need * point dentry is definitely not a root, so we won't need
* that anymore. * that anymore.
*/ */
if (devname_garbage)
kfree(devname_garbage); kfree(devname_garbage);
return 0; return 0;
out_unlock: out_unlock: