Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96aa1549 authored by Tim Gardner's avatar Tim Gardner Committed by Trond Myklebust
Browse files

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: default avatarTim Gardner <tim.gardner@canonical.com>
Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 085b7a45
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -126,7 +126,6 @@ struct dentry *nfs_get_root(struct super_block *sb, struct nfs_fh *mntfh,
	}
	spin_unlock(&ret->d_lock);
out:
	if (name)
	kfree(name);
	nfs_free_fattr(fsinfo.fattr);
	return ret;
+1 −2
Original line number Diff line number Diff line
@@ -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
	 * that anymore.
	 */
	if (devname_garbage)
	kfree(devname_garbage);
	return 0;
out_unlock: