Skip to contentSkip to conversation

io_uring: fix task leak issue in io_wq_create()

PATCH Applied Penglei Jiang 2 participants 2 messages Jun 15, 2025 io_uring

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 io_uring: fix task leak issue in io_wq_create()

Add missing put_task_struct() in the error path

Fixes 0f8baa3c9802 ("io-wq: fully initialize wqe before calling cpuhp_state_add_instance_nocalls()")
---
 io_uring/io-wq.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
io_uring/io-wq.c +3 -1
index cd1fcb115739..be91edf34f01 100644
@@ -1259,8 +1259,10 @@ struct io_wq *io_wq_create(unsigned bounded, struct io_wq_data *data)
 	atomic_set(&wq->worker_refs, 1);
 	init_completion(&wq->worker_done);
 	ret = cpuhp_state_add_instance_nocalls(io_wq_online, &wq->cpuhp_node);
-	if (ret)
+	if (ret) {
+		put_task_struct(wq->task);
 		goto err;
+	}
 
 	return wq;
 err:
Signature · 1 line
2.17.1
maintainer Applied
#1 lore raw
Quoted 3 lines · Penglei Jiang

Add missing put_task_struct() in the error path

Applied, thanks!

[1/1] io_uring: fix task leak issue in io_wq_create()

      commit: 89465d923bda180299e69ee2800aab84ad0ba689

Best regards,

Signature · 1 line
Jens Axboe