summaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDominique Martinet <dominique.martinet@cea.fr>2018-10-09 04:38:00 +0200
committerDominique Martinet <dominique.martinet@cea.fr>2018-10-10 02:14:34 +0200
commitfb488fc1f2b4c5128540b032892ddec91edaf8d9 (patch)
treef93afcb06935d0842106be7e80e434a681621812 /net
parent9p/trans_fd: abort p9_read_work if req status changed (diff)
downloadlinux-fb488fc1f2b4c5128540b032892ddec91edaf8d9.tar.xz
linux-fb488fc1f2b4c5128540b032892ddec91edaf8d9.zip
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: 728356dedeff8 ("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>
Diffstat (limited to 'net')
-rw-r--r--net/9p/trans_fd.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index a0317d459cde..f868cf6fba79 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -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);