diff mbox

[V9fs-developer,net/9p] Add a Warning to catch NULL fids passed to p9_client_clunk().

Message ID 1282753626-28268-1-git-send-email-jvrao@linux.vnet.ibm.com (mailing list archive)
State Accepted, archived
Headers show

Commit Message

jvrao Aug. 25, 2010, 4:27 p.m. UTC
None
diff mbox

Patch

diff --git a/net/9p/client.c b/net/9p/client.c
index dc6f2f2..aa7be29 100644
--- a/net/9p/client.c
+++ b/net/9p/client.c
@@ -1201,6 +1201,12 @@  int p9_client_clunk(struct p9_fid *fid)
 	struct p9_client *clnt;
 	struct p9_req_t *req;
 
+	if (!fid) {
+		P9_EPRINTK(KERN_WARNING, "Trying to clunk with NULL fid\n");
+		dump_stack();
+		return 0;
+	}
+
 	P9_DPRINTK(P9_DEBUG_9P, ">>> TCLUNK fid %d\n", fid->fid);
 	err = 0;
 	clnt = fid->clnt;