summaryrefslogtreecommitdiffstats
path: root/net/9p
diff options
context:
space:
mode:
authorHangyu Hua <hbh25y@gmail.com>2022-07-13 02:55:11 +0200
committerDominique Martinet <asmadeus@codewreck.org>2022-07-15 13:22:21 +0200
commit4ac7573e1f9333073fa8d303acc941c9b7ab7f61 (patch)
treedb109559de7b8c0616e73565279d7837f28fae18 /net/9p
parent9p: roll p9_tag_remove into p9_req_put (diff)
downloadlinux-4ac7573e1f9333073fa8d303acc941c9b7ab7f61.tar.xz
linux-4ac7573e1f9333073fa8d303acc941c9b7ab7f61.zip
net: 9p: fix refcount leak in p9_read_work() error handling
p9_req_put need to be called when m->rreq->rc.sdata is NULL to avoid temporary refcount leak. Link: https://lkml.kernel.org/r/20220712104438.30800-1-hbh25y@gmail.com Fixes: 728356dedeff ("9p: Add refcount to p9_req_t") Signed-off-by: Hangyu Hua <hbh25y@gmail.com> [Dominique: commit wording adjustments, p9_req_put argument fixes for rebase] Signed-off-by: Dominique Martinet <asmadeus@codewreck.org>
Diffstat (limited to 'net/9p')
-rw-r--r--net/9p/trans_fd.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/net/9p/trans_fd.c b/net/9p/trans_fd.c
index 007c3f45fe05..e758978b44be 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -343,6 +343,7 @@ static void p9_read_work(struct work_struct *work)
p9_debug(P9_DEBUG_ERROR,
"No recv fcall for tag %d (req %p), disconnecting!\n",
m->rc.tag, m->rreq);
+ p9_req_put(m->client, m->rreq);
m->rreq = NULL;
err = -EIO;
goto error;