Skip to content

Commit fb488fc

Browse files
author
Dominique Martinet
committed
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: 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>
1 parent e4ca13f commit fb488fc

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

‎net/9p/trans_fd.c‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,15 @@ static void p9_conn_destroy(struct p9_conn *m)
876876

877877
p9_mux_poll_stop(m);
878878
cancel_work_sync(&m->rq);
879+
if (m->rreq) {
880+
p9_req_put(m->rreq);
881+
m->rreq = NULL;
882+
}
879883
cancel_work_sync(&m->wq);
884+
if (m->wreq) {
885+
p9_req_put(m->wreq);
886+
m->wreq = NULL;
887+
}
880888

881889
p9_conn_cancel(m, -ECONNRESET);
882890

0 commit comments

Comments
 (0)