From: Jens Axboe Date: Wed, 15 Apr 2026 20:22:16 +0000 (-0600) Subject: io_uring/tctx: check for setup tctx->io_wq before teardown X-Git-Tag: v7.1-rc1~11^2~13 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=ee5417fd02cabb6235a89daf5142ffde9aa957fd;p=thirdparty%2Fkernel%2Flinux.git io_uring/tctx: check for setup tctx->io_wq before teardown 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 Reviewed-by: Clément Léger Signed-off-by: Jens Axboe --- 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); }