Skip to content

Commit 042ff84

Browse files
committed
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: 7880174 ("io_uring/tctx: clean up __io_uring_add_tctx_node() error handling") Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 326941b commit 042ff84

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

io_uring/tctx.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ int __io_uring_add_tctx_node(struct io_ring_ctx *ctx)
171171
}
172172
if (!current->io_uring) {
173173
err_free:
174-
io_wq_put_and_exit(tctx->io_wq);
174+
if (tctx->io_wq)
175+
io_wq_put_and_exit(tctx->io_wq);
175176
percpu_counter_destroy(&tctx->inflight);
176177
kfree(tctx);
177178
}

0 commit comments

Comments
 (0)