* [PATCH v2] io_uring: check for iowq alloc_workqueue errors
@ 2025-01-31 16:34 Pavel Begunkov
0 siblings, 0 replies; only message in thread
From: Pavel Begunkov @ 2025-01-31 16:34 UTC (permalink / raw)
To: io-uring; +Cc: asml.silence
alloc_workqueue() can fail, check the result and return an error back
from io_uring_init() if anything goes wrong.
Fixes: 73eaa2b583493 ("io_uring: use private workqueue for exit work")
Signed-off-by: Pavel Begunkov <[email protected]>
---
v2: drop other patches
io_uring/io_uring.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 263e504be4a8b..4d6d2c494046c 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -3920,6 +3920,8 @@ static int __init io_uring_init(void)
SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT);
iou_wq = alloc_workqueue("iou_exit", WQ_UNBOUND, 64);
+ if (!iou_wq)
+ return -ENOMEM;
#ifdef CONFIG_SYSCTL
register_sysctl_init("kernel", kernel_io_uring_disabled_table);
--
2.47.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2025-01-31 16:33 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-31 16:34 [PATCH v2] io_uring: check for iowq alloc_workqueue errors Pavel Begunkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox