提交 ecce3494 编写于 作者: J Jens Axboe 提交者: sanglipeng

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

stable inclusion
from stable-v5.10.164
commit b912ed1363b363d587fe1aac9636ce9e9366a775
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7T7G4

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b912ed1363b363d587fe1aac9636ce9e9366a775

--------------------------------

commit af82425c 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: N진호 <wnwlsgh98@gmail.com>
Signed-off-by: NJens Axboe <axboe@kernel.dk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
上级 abd4a038
...@@ -1217,6 +1217,7 @@ static void io_wq_cancel_tw_create(struct io_wq *wq) ...@@ -1217,6 +1217,7 @@ static void io_wq_cancel_tw_create(struct io_wq *wq)
worker = container_of(cb, struct io_worker, create_work); worker = container_of(cb, struct io_worker, create_work);
io_worker_cancel_cb(worker); io_worker_cancel_cb(worker);
kfree(worker);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册