It's very unlikely, but in theory cache creation can fail during initcall, so don't forget to return errors back if something goes wrong. Fixes: b3a4dbc89d402 ("io_uring/kbuf: Use slab for struct io_buffer objects") Signed-off-by: Pavel Begunkov <asml.silence@xxxxxxxxx> --- 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 9335144495299..b05580c1a6424 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -3921,6 +3921,8 @@ static int __init io_uring_init(void) io_buf_cachep = KMEM_CACHE(io_buffer, SLAB_HWCACHE_ALIGN | SLAB_PANIC | SLAB_ACCOUNT); + if (!io_buf_cachep) + return -ENOMEM; iou_wq = alloc_workqueue("iou_exit", WQ_UNBOUND, 64); -- 2.47.1