public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC: 2.6 patch] include/linux/nfsd/nfsfh.h: fix a NULL
@ 2006-11-12 13:17 Adrian Bunk
  2006-11-12 15:58 ` [NFS] " Trond Myklebust
  0 siblings, 1 reply; 4+ messages in thread
From: Adrian Bunk @ 2006-11-12 13:17 UTC (permalink / raw)
  To: neilb; +Cc: nfs, linux-kernel

dereference
Reply-To: 
Fcc: =sent-mail

When we know fhp->fh_dentry is NULL, a code path where it's being 
dereferenced isn't a good choice.

Spotted by the coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>

--- linux-2.6/include/linux/nfsd/nfsfh.h.old	2006-11-12 14:13:34.000000000 +0100
+++ linux-2.6/include/linux/nfsd/nfsfh.h	2006-11-12 14:13:49.000000000 +0100
@@ -330,8 +330,7 @@ fh_unlock(struct svc_fh *fhp)
 {
 	if (!fhp->fh_dentry)
 		printk(KERN_ERR "fh_unlock: fh not verified!\n");
-
-	if (fhp->fh_locked) {
+	else if (fhp->fh_locked) {
 		fill_post_wcc(fhp);
 		mutex_unlock(&fhp->fh_dentry->d_inode->i_mutex);
 		fhp->fh_locked = 0;


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2006-11-13  4:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-11-12 13:17 [RFC: 2.6 patch] include/linux/nfsd/nfsfh.h: fix a NULL Adrian Bunk
2006-11-12 15:58 ` [NFS] " Trond Myklebust
2006-11-12 17:48   ` [2.6 patch] include/linux/nfsd/nfsfh.h:fh_unlock(): change an error to a BUG_ON() Adrian Bunk
2006-11-13  4:52     ` Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox