Skip to content

Commit 4ac7573

Browse files
HBh25Ymartinetd
authored andcommitted
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: 728356d ("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>
1 parent 67dd8e4 commit 4ac7573

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/9p/trans_fd.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -343,6 +343,7 @@ static void p9_read_work(struct work_struct *work)
343343
p9_debug(P9_DEBUG_ERROR,
344344
"No recv fcall for tag %d (req %p), disconnecting!\n",
345345
m->rc.tag, m->rreq);
346+
p9_req_put(m->client, m->rreq);
346347
m->rreq = NULL;
347348
err = -EIO;
348349
goto error;

0 commit comments

Comments
 (0)