Skip to content

Commit 3053600

Browse files
Dominique Martinetericvh
authored andcommitted
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>
1 parent 947867a commit 3053600

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

net/9p/trans_fd.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -356,13 +356,12 @@ static void p9_read_work(struct work_struct *work)
356356
}
357357

358358
if (m->req->rc == NULL) {
359-
m->req->rc = kmalloc(sizeof(struct p9_fcall) +
360-
m->client->msize, GFP_NOFS);
361-
if (!m->req->rc) {
362-
m->req = NULL;
363-
err = -ENOMEM;
364-
goto error;
365-
}
359+
p9_debug(P9_DEBUG_ERROR,
360+
"No recv fcall for tag %d (req %p), disconnecting!\n",
361+
m->rc.tag, m->req);
362+
m->req = NULL;
363+
err = -EIO;
364+
goto error;
366365
}
367366
m->rc.sdata = (char *)m->req->rc + sizeof(struct p9_fcall);
368367
memcpy(m->rc.sdata, m->tmp_buf, m->rc.capacity);

0 commit comments

Comments
 (0)