nfs: remove kfree() redundant null checks
authorTim Gardner <tim.gardner@canonical.com>
Tue, 12 Feb 2013 20:03:42 +0000 (13:03 -0700)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Sun, 17 Feb 2013 20:27:21 +0000 (15:27 -0500)
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>
fs/nfs/getroot.c
fs/nfs/unlink.c

index 033803c36644289b449bcb568e79cdb256ccb1fd..44efaa8c5f78f38bda40753542740874b50c7155 100644 (file)
@@ -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;
 }
index 13cea637eff82288f2f5508023a592e60db3fa7a..d26a32f5b53b451bafdd75b9ab0ac99e63c2f27f 100644 (file)
@@ -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);