summaryrefslogtreecommitdiff
path: root/fs/9p
diff options
context:
space:
mode:
authorjvrao <jvrao@linux.vnet.ibm.com>2010-08-25 16:26:21 +0000
committerEric Van Hensbergen <ericvh@gmail.com>2010-09-13 08:13:03 -0500
commit62726a7ab3a6a3624256172af055ff0a38c6ffa2 (patch)
treefea6290c7232a1cbf9d144419a36ef62aaa04cdb /fs/9p
parent5c25f347a7b00b2ebe0a55c4a3cfe4c3e1e8725e (diff)
downloadlinux-3.10-62726a7ab3a6a3624256172af055ff0a38c6ffa2.tar.gz
linux-3.10-62726a7ab3a6a3624256172af055ff0a38c6ffa2.tar.bz2
linux-3.10-62726a7ab3a6a3624256172af055ff0a38c6ffa2.zip
9p: Check for NULL fid in v9fs_dir_release()
NULL fid should be handled in cases where we endup calling v9fs_dir_release() before even we instantiate the fid in filp. Signed-off-by: Venkateswararao Jujjuri <jvrao@linux.vnet.ibm.com> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'fs/9p')
-rw-r--r--fs/9p/vfs_dir.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/9p/vfs_dir.c b/fs/9p/vfs_dir.c
index 16c8a2a98c1..899f168fd19 100644
--- a/fs/9p/vfs_dir.c
+++ b/fs/9p/vfs_dir.c
@@ -292,9 +292,11 @@ 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);
+ "v9fs_dir_release: inode: %p filp: %p fid: %d\n",
+ inode, filp, fid ? fid->fid : -1);
filemap_write_and_wait(inode->i_mapping);
- p9_client_clunk(fid);
+ if (fid)
+ p9_client_clunk(fid);
return 0;
}