summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHangyu Hua <hbh25y@gmail.com>2026-06-18 15:19:21 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-07-04 13:38:37 +0200
commit9bc63a124cc20a69a126e45e3d593d5807bb5258 (patch)
treedb59a3eb05da0e1e70d3792b275c314634b3a4bf
parent9540b0a4d13e4ede64ae1197d66a176d2149daa9 (diff)
downloadlinux-9bc63a124cc20a69a126e45e3d593d5807bb5258.tar.gz
linux-9bc63a124cc20a69a126e45e3d593d5807bb5258.zip
net: 9p: fix refcount leak in p9_read_work() error handling
commit 4ac7573e1f9333073fa8d303acc941c9b7ab7f61 upstream. 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> [Alexander: this branch doesn't contain 8b11ff098af4 ("9p: Add client parameter to p9_req_put()"), therefore the parameter is removed from the added line] Signed-off-by: Alexander Martyniuk <alexevgmart@gmail.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
-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 40d458c438df..a75668534c81 100644
--- a/net/9p/trans_fd.c
+++ b/net/9p/trans_fd.c
@@ -346,6 +346,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->rreq);
m->rreq = NULL;
err = -EIO;
goto error;