From: Chuck Lever Date: Fri, 20 Oct 2006 06:28:42 +0000 (-0700) Subject: [PATCH] NFS: __nfs_revalidate_inode() can use "inode" before checking it is non-NULL X-Git-Tag: v2.6.19-rc3~86 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85233a7a436a48a0b98e7976a66797e5da79c9d6;p=linux-2.6 [PATCH] NFS: __nfs_revalidate_inode() can use "inode" before checking it is non-NULL 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 Signed-off-by: Trond Myklebust Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c index 9979ad1cf8..08cc4c5919 100644 --- a/fs/nfs/inode.c +++ b/fs/nfs/inode.c @@ -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;