Skip to content

Commit

Permalink
net: 9p: fix refcount leak in p9_read_work() error handling
Browse files Browse the repository at this point in the history
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/[email protected]
Fixes: 728356d ("9p: Add refcount to p9_req_t")
Signed-off-by: Hangyu Hua <[email protected]>
[Dominique: commit wording adjustments, p9_req_put argument fixes for rebase]
Signed-off-by: Dominique Martinet <[email protected]>
  • Loading branch information
HBh25Y authored and martinetd committed Jul 15, 2022
1 parent 67dd8e4 commit 4ac7573
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions net/9p/trans_fd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 4ac7573

Please sign in to comment.