9p/trans_fd: put worker reqs on destroy

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: 728356dede ("9p: Add refcount to p9_req_t")
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Dominique Martinet <[email protected]>
Cc: Eric Van Hensbergen <[email protected]>
Cc: Latchesar Ionkov <[email protected]>
Reviewed-by: Tomas Bortoli <[email protected]>
This commit is contained in:
Dominique Martinet 2018-10-09 11:38:00 +09:00
commit fb488fc1f2

View file

@ -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);