Skip to content

Commit

Permalink
nfs: remove kfree() redundant null checks
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Tim Gardner authored and Trond Myklebust committed Feb 17, 2013
1 parent 085b7a4 commit 96aa154
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions fs/nfs/getroot.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ struct dentry *nfs_get_root(struct super_block *sb, struct nfs_fh *mntfh,
}
spin_unlock(&ret->d_lock);
out:
if (name)
kfree(name);
kfree(name);
nfs_free_fattr(fsinfo.fattr);
return ret;
}
3 changes: 1 addition & 2 deletions fs/nfs/unlink.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,7 @@ nfs_async_unlink(struct inode *dir, struct dentry *dentry)
* point dentry is definitely not a root, so we won't need
* that anymore.
*/
if (devname_garbage)
kfree(devname_garbage);
kfree(devname_garbage);
return 0;
out_unlock:
spin_unlock(&dentry->d_lock);
Expand Down

0 comments on commit 96aa154

Please sign in to comment.