]> Git Repo - linux.git/commitdiff
9p/trans_fd: put worker reqs on destroy
authorDominique Martinet <[email protected]>
Tue, 9 Oct 2018 02:38:00 +0000 (11:38 +0900)
committerDominique Martinet <[email protected]>
Wed, 10 Oct 2018 00:14:34 +0000 (09:14 +0900)
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: 728356dedeff8 ("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]>
net/9p/trans_fd.c

index a0317d459cdefb7f41d8b65fa8eb61757b1e797f..f868cf6fba7946c87d0bb152dbd35ba61e3eb0fb 100644 (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);
 
This page took 0.055032 seconds and 4 git commands to generate.