From: "Clément Léger" <cleger@meta.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Cc: Dan Carpenter <error27@gmail.com>
Subject: Re: [PATCH 1/2] io_uring/tctx: check for setup tctx->io_wq before teardown
Date: Mon, 20 Apr 2026 10:42:50 +0200 [thread overview]
Message-ID: <d8214fb9-69eb-47fb-a79a-8e14cb5d913d@meta.com> (raw)
In-Reply-To: <20260416200622.831635-2-axboe@kernel.dk>
On 4/16/26 22:05, Jens Axboe wrote:
> >
> As with the idling code before it, the error exit path should check for
> a NULL tctx->io_wq before calling io_wq_put_and_exit().
>
> Fixes: 7880174e1e5e ("io_uring/tctx: clean up __io_uring_add_tctx_node() error handling")
> Reported-by: Dan Carpenter <error27@gmail.com>
> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> ---
> io_uring/tctx.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/io_uring/tctx.c b/io_uring/tctx.c
> index 61533f30494f..c011a593c0ad 100644
> --- a/io_uring/tctx.c
> +++ b/io_uring/tctx.c
> @@ -171,7 +171,8 @@ int __io_uring_add_tctx_node(struct io_ring_ctx *ctx)
> }
> if (!current->io_uring) {
> err_free:
> - io_wq_put_and_exit(tctx->io_wq);
> + if (tctx->io_wq)
> + io_wq_put_and_exit(tctx->io_wq);
> percpu_counter_destroy(&tctx->inflight);
> kfree(tctx);
> }
Hi Jens,
LGTM,
Reviewed-by: Clément Léger <cleger@meta.com>
Thanks,
Clément
next prev parent reply other threads:[~2026-04-20 8:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-16 20:05 [PATCH 0/2] Misc minor tctx fixes Jens Axboe
2026-04-16 20:05 ` [PATCH 1/2] io_uring/tctx: check for setup tctx->io_wq before teardown Jens Axboe
2026-04-20 8:42 ` Clément Léger [this message]
2026-04-16 20:05 ` [PATCH 2/2] io_uring/tctx: mark io_wq as exiting before error path teardown Jens Axboe
2026-04-20 8:44 ` Clément Léger
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d8214fb9-69eb-47fb-a79a-8e14cb5d913d@meta.com \
--to=cleger@meta.com \
--cc=axboe@kernel.dk \
--cc=error27@gmail.com \
--cc=io-uring@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox