Skip to content

Commit

Permalink
io_uring/io-wq: free worker if task_work creation is canceled
Browse files Browse the repository at this point in the history
commit af82425 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: 진호 <wnwlsgh98@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
axboe authored and gregkh committed Jan 18, 2023
1 parent 3925336 commit 0a14c3d
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions io_uring/io-wq.c
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit 0a14c3d

Please sign in to comment.