[PATCH 2/3] io_uring: propagate io_buffer creation errors

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux