Skip to content

Commit

Permalink
9p: trans_fd, bail out if recv fcall if missing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dominique Martinet authored and Eric Van Hensbergen committed Nov 14, 2015
1 parent 947867a commit 3053600
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions net/9p/trans_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,13 +356,12 @@ static void p9_read_work(struct work_struct *work)
}

if (m->req->rc == NULL) {
m->req->rc = kmalloc(sizeof(struct p9_fcall) +
m->client->msize, GFP_NOFS);
if (!m->req->rc) {
m->req = NULL;
err = -ENOMEM;
goto error;
}
p9_debug(P9_DEBUG_ERROR,
"No recv fcall for tag %d (req %p), disconnecting!\n",
m->rc.tag, m->req);
m->req = NULL;
err = -EIO;
goto error;
}
m->rc.sdata = (char *)m->req->rc + sizeof(struct p9_fcall);
memcpy(m->rc.sdata, m->tmp_buf, m->rc.capacity);
Expand Down

0 comments on commit 3053600

Please sign in to comment.