]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[PATCH] NFS: __nfs_revalidate_inode() can use "inode" before checking it is non-NULL
authorChuck Lever <chuck.lever@oracle.com>
Fri, 20 Oct 2006 06:28:42 +0000 (23:28 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Fri, 20 Oct 2006 17:26:39 +0000 (10:26 -0700)
The "!inode" check in __nfs_revalidate_inode() occurs well after the first
time it is dereferenced, so get rid of it.

Coverity: #cid 1372, 1373

Test plan:
Code review; recheck with Coverity.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
fs/nfs/inode.c

index 9979ad1cf8eb9668dde0072d2bab7e37eedd0444..08cc4c5919abee92f1f28b411e1154c627ff15d3 100644 (file)
@@ -583,7 +583,7 @@ __nfs_revalidate_inode(struct nfs_server *server, struct inode *inode)
 
        nfs_inc_stats(inode, NFSIOS_INODEREVALIDATE);
        lock_kernel();
-       if (!inode || is_bad_inode(inode))
+       if (is_bad_inode(inode))
                goto out_nowait;
        if (NFS_STALE(inode))
                goto out_nowait;