Commit 62726a7a authored by jvrao's avatar jvrao Committed by Eric Van Hensbergen

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: default avatarVenkateswararao Jujjuri <jvrao@linux.vnet.ibm.com>
Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
parent 5c25f347
...@@ -292,9 +292,11 @@ int v9fs_dir_release(struct inode *inode, struct file *filp) ...@@ -292,9 +292,11 @@ int v9fs_dir_release(struct inode *inode, struct file *filp)
fid = filp->private_data; fid = filp->private_data;
P9_DPRINTK(P9_DEBUG_VFS, 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); filemap_write_and_wait(inode->i_mapping);
p9_client_clunk(fid); if (fid)
p9_client_clunk(fid);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment