Commit ee5417fd authored by Jens Axboe's avatar Jens Axboe
Browse files

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: 7880174e ("io_uring/tctx: clean up __io_uring_add_tctx_node() error handling")
Reported-by: default avatarDan Carpenter <error27@gmail.com>
Reviewed-by: default avatarClément Léger <cleger@meta.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 326941b2
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -171,6 +171,7 @@ int __io_uring_add_tctx_node(struct io_ring_ctx *ctx)
	}
	if (!current->io_uring) {
err_free:
		if (tctx->io_wq)
			io_wq_put_and_exit(tctx->io_wq);
		percpu_counter_destroy(&tctx->inflight);
		kfree(tctx);