Skip to contentSkip to conversation

io_uring/io-wq: free worker if task_work creation is canceled

PATCH New Jens Axboe 1 participant 1 message Jan 3, 2023 io_uring

lore
Share & tools
lore

Jens Axboe

author maintainer
#0 lore raw

PATCH 1/1 io_uring/io-wq: free worker if task_work creation is canceled

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.

---

io_uring/io-wq.c +1 -0
index 6f1d0e5df23a..992dcd9f8c4c 100644
@@ -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);
 	}
 }
 
Signature · 1 line
Jens Axboe