From: Jens Axboe Date: Mon, 2 Jan 2023 23:49:46 +0000 (-0700) Subject: io_uring/io-wq: free worker if task_work creation is canceled X-Git-Tag: v6.1.8~194 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0a14c3ded80c7dd399e68f361ee3338b5271c98e;p=platform%2Fkernel%2Flinux-starfive.git io_uring/io-wq: free worker if task_work creation is canceled commit af82425c6a2d2f347c79b63ce74fca6dc6be157f upstream. 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: stable@vger.kernel.org Reported-by: 진호 Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- 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); } }