public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH] io_uring/io-wq: free worker if task_work creation is canceled
@ 2023-01-03 14:32 Jens Axboe
  0 siblings, 0 replies; only message in thread
From: Jens Axboe @ 2023-01-03 14:32 UTC (permalink / raw)
  To: io-uring

If we cancel the task_work, the worker will never come into existance.
As this is the last reference to it, ensure that we get it freed
appropriately.

Cc: [email protected]
Reported-by: 진호 <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>

---

diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c
index 6f1d0e5df23a..992dcd9f8c4c 100644
--- a/io_uring/io-wq.c
+++ b/io_uring/io-wq.c
@@ -1230,6 +1230,7 @@ static void io_wq_cancel_tw_create(struct io_wq *wq)
 
 		worker = container_of(cb, struct io_worker, create_work);
 		io_worker_cancel_cb(worker);
+		kfree(worker);
 	}
 }
 
-- 
Jens Axboe


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2023-01-03 14:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-03 14:32 [PATCH] io_uring/io-wq: free worker if task_work creation is canceled Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox