summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2026-04-15 23:22:16 +0300
committerJens Axboe <axboe@kernel.dk>2026-04-20 23:47:29 +0300
commitee5417fd02cabb6235a89daf5142ffde9aa957fd (patch)
treee8a45ccb4ab229c9e875bef7b7bf77da650063f4
parent326941b22806cbf2df1fbfe902b7908b368cce42 (diff)
downloadlinux-ee5417fd02cabb6235a89daf5142ffde9aa957fd.tar.xz
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 <error27@gmail.com> Reviewed-by: Clément Léger <cleger@meta.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--io_uring/tctx.c3
1 files changed, 2 insertions, 1 deletions
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);
}