From: Pavel Begunkov Date: Fri, 31 Jan 2025 17:28:21 +0000 (+0000) Subject: io_uring: check for iowq alloc_workqueue failure X-Git-Tag: v6.15-rc1~124^2~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7215469659cb9751a9bf80e43b24a48749004d26;p=thirdparty%2Fkernel%2Flinux.git io_uring: check for iowq alloc_workqueue failure alloc_workqueue() can fail even during init in io_uring_init(), check the result and panic if anything went wrong. Fixes: 73eaa2b583493 ("io_uring: use private workqueue for exit work") Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/3a046063902f888f66151f89fa42f84063b9727b.1738343083.git.asml.silence@gmail.com Signed-off-by: Jens Axboe --- diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 9fade03ce0d97..7fff5d612201b 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -3920,6 +3920,7 @@ static int __init io_uring_init(void) SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT); iou_wq = alloc_workqueue("iou_exit", WQ_UNBOUND, 64); + BUG_ON(!iou_wq); #ifdef CONFIG_SYSCTL register_sysctl_init("kernel", kernel_io_uring_disabled_table);