Skip to content

Commit

Permalink
9p/trans_fd: put worker reqs on destroy
Browse files Browse the repository at this point in the history
p9_read_work/p9_write_work might still hold references to a req after
having been cancelled; make sure we put any of these to avoid potential
request leak on disconnect.

Fixes: 728356d ("9p: Add refcount to p9_req_t")
Link: http://lkml.kernel.org/r/1539057956-23741-2-git-send-email-asmadeus@codewreck.org
Signed-off-by: Dominique Martinet <dominique.martinet@cea.fr>
Cc: Eric Van Hensbergen <ericvh@gmail.com>
Cc: Latchesar Ionkov <lucho@ionkov.net>
Reviewed-by: Tomas Bortoli <tomasbortoli@gmail.com>
  • Loading branch information
Dominique Martinet committed Oct 10, 2018
1 parent e4ca13f commit fb488fc
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions net/9p/trans_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,15 @@ static void p9_conn_destroy(struct p9_conn *m)

p9_mux_poll_stop(m);
cancel_work_sync(&m->rq);
if (m->rreq) {
p9_req_put(m->rreq);
m->rreq = NULL;
}
cancel_work_sync(&m->wq);
if (m->wreq) {
p9_req_put(m->wreq);
m->wreq = NULL;
}

p9_conn_cancel(m, -ECONNRESET);

Expand Down

0 comments on commit fb488fc

Please sign in to comment.