linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com>
To: v9fs-developer@lists.sourceforge.net
Cc: linux-fsdevel@vger.kernel.org,
	"Venkateswararao Jujjuri (JV)" <jvrao@linux.vnet.ibm.com>
Subject: [PATCH] [fs/9p] Fix NULL point deref in v9fs_dir_release
Date: Tue, 17 Aug 2010 10:19:01 -0700	[thread overview]
Message-ID: <1282065541-3775-1-git-send-email-jvrao@linux.vnet.ibm.com> (raw)

There are situations in VFS where we endup calling v9fs_dir_release() before
even we instantiate the filp. Hence the check.

Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
---
 fs/9p/vfs_dir.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 16c8a2a..9be9b35 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -290,6 +290,8 @@ int v9fs_dir_release(struct inode *inode, struct file *filp)
 {
 	struct p9_fid *fid;
 
+	if (!filp)
+		return 0;
 	fid = filp->private_data;
 	P9_DPRINTK(P9_DEBUG_VFS,
 			"inode: %p filp: %p fid: %d\n", inode, filp, fid->fid);
-- 
1.6.5.2


             reply	other threads:[~2010-08-17 17:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-17 17:19 Venkateswararao Jujjuri (JV) [this message]
2010-08-17 17:13 ` [PATCH] [fs/9p] Fix NULL point deref in v9fs_dir_release Christoph Hellwig
2010-08-17 18:37   ` Venkateswararao Jujjuri (JV)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1282065541-3775-1-git-send-email-jvrao@linux.vnet.ibm.com \
    --to=jvrao@linux.vnet.ibm.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=v9fs-developer@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).