Commit 3053600e authored by Dominique Martinet's avatar Dominique Martinet Committed by Eric Van Hensbergen

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: default avatarDominique Martinet <dominique.martinet@cea.fr>
Signed-off-by: default avatarEric Van Hensbergen <ericvh@gmail.com>
parent 947867aa
...@@ -356,14 +356,13 @@ static void p9_read_work(struct work_struct *work) ...@@ -356,14 +356,13 @@ static void p9_read_work(struct work_struct *work)
} }
if (m->req->rc == NULL) { if (m->req->rc == NULL) {
m->req->rc = kmalloc(sizeof(struct p9_fcall) + p9_debug(P9_DEBUG_ERROR,
m->client->msize, GFP_NOFS); "No recv fcall for tag %d (req %p), disconnecting!\n",
if (!m->req->rc) { m->rc.tag, m->req);
m->req = NULL; m->req = NULL;
err = -ENOMEM; err = -EIO;
goto error; goto error;
} }
}
m->rc.sdata = (char *)m->req->rc + sizeof(struct p9_fcall); m->rc.sdata = (char *)m->req->rc + sizeof(struct p9_fcall);
memcpy(m->rc.sdata, m->tmp_buf, m->rc.capacity); memcpy(m->rc.sdata, m->tmp_buf, m->rc.capacity);
m->rc.capacity = m->rc.size; m->rc.capacity = m->rc.size;
......
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