aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDominique Martinet <dominique.martinet@cea.fr>2015-09-07 11:06:54 -0400
committerEric Van Hensbergen <ericvh@gmail.com>2015-11-14 09:12:41 -0500
commit3053600ed4f71115631258f0d64eca0d10b11bdc (patch)
tree46a437bf97ce05340f87b7a3141d5628a434411f /net
parent947867aa195b65471f4767fdf761e3841577f90e (diff)
9p: trans_fd, bail out if recv fcall if missing
req->rc is pre-allocated early on with p9_tag_alloc and shouldn't be missing Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr> Signed-off-by: Eric Van Hensbergen <ericvh@gmail.com>
Diffstat (limited to 'net')
-rw-r--r--net/9p/trans_fd.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index a270dcc4ad9a..7bc2208b6cc4 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -356,13 +356,12 @@ static void p9_read_work(struct work_struct *work)
356 } 356 }
357 357
358 if (m->req->rc == NULL) { 358 if (m->req->rc == NULL) {
359 m->req->rc = kmalloc(sizeof(struct p9_fcall) + 359 p9_debug(P9_DEBUG_ERROR,
360 m->client->msize, GFP_NOFS); 360 "No recv fcall for tag %d (req %p), disconnecting!\n",
361 if (!m->req->rc) { 361 m->rc.tag, m->req);
362 m->req = NULL; 362 m->req = NULL;
363 err = -ENOMEM; 363 err = -EIO;
364 goto error; 364 goto error;
365 }
366 } 365 }
367 m->rc.sdata = (char *)m->req->rc + sizeof(struct p9_fcall); 366 m->rc.sdata = (char *)m->req->rc + sizeof(struct p9_fcall);
368 memcpy(m->rc.sdata, m->tmp_buf, m->rc.capacity); 367 memcpy(m->rc.sdata, m->tmp_buf, m->rc.capacity);