diff mbox

[V9fs-developer,fs/9p] Check for NULL fid pointers in p9_client_clunk()

Message ID 1282664585-12450-1-git-send-email-jvrao@linux.vnet.ibm.com (mailing list archive)
State Changes Requested, archived
Delegated to: Eric Van Hensbergen
Headers show

Commit Message

jvrao Aug. 24, 2010, 3:43 p.m. UTC
None
diff mbox

Patch

diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 16c8a2a..5f08203 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -292,7 +292,8 @@  int v9fs_dir_release(struct inode *inode, struct file *filp)
 
 	fid = filp->private_data;
 	P9_DPRINTK(P9_DEBUG_VFS,
-			"inode: %p filp: %p fid: %d\n", inode, filp, fid->fid);
+			"JV: inode: %p filp: %p fid: %d\n", inode, filp,
+			fid ? fid->fid : -1);
 	filemap_write_and_wait(inode->i_mapping);
 	p9_client_clunk(fid);
 	return 0;
diff --git a/net/9p/client.c b/net/9p/client.c
index dc6f2f2..9338fb3 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1201,6 +1201,9 @@  int p9_client_clunk(struct p9_fid *fid)
 	struct p9_client *clnt;
 	struct p9_req_t *req;
 
+	if (!fid)
+		return 0;
+
 	P9_DPRINTK(P9_DEBUG_9P, ">>> TCLUNK fid %d\n", fid->fid);
 	err = 0;
 	clnt = fid->clnt;