summaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDuoming Zhou <duoming@zju.edu.cn>2024-03-06 10:12:59 +0100
committerRichard Weinberger <richard@nod.at>2024-04-22 21:38:23 +0200
commit31a5990ed253a66712d7ddc29c92d297a991fdf2 (patch)
tree03be64d613c2619918313c77e8942079781235b3 /arch
parentLinux 6.9-rc5 (diff)
downloadlinux-31a5990ed253a66712d7ddc29c92d297a991fdf2.tar.xz
linux-31a5990ed253a66712d7ddc29c92d297a991fdf2.zip
um: Fix return value in ubd_init()
When kmalloc_array() fails to allocate memory, the ubd_init() should return -ENOMEM instead of -1. So, fix it. Fixes: f88f0bdfc32f ("um: UBD Improvements") Signed-off-by: Duoming Zhou <duoming@zju.edu.cn> Reviewed-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch')
-rw-r--r--arch/um/drivers/ubd_kern.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/um/drivers/ubd_kern.c b/arch/um/drivers/ubd_kern.c
index 63fc062add70..ef805eaa9e01 100644
--- a/arch/um/drivers/ubd_kern.c
+++ b/arch/um/drivers/ubd_kern.c
@@ -1092,7 +1092,7 @@ static int __init ubd_init(void)
if (irq_req_buffer == NULL) {
printk(KERN_ERR "Failed to initialize ubd buffering\n");
- return -1;
+ return -ENOMEM;
}
io_req_buffer = kmalloc_array(UBD_REQ_BUFFER_SIZE,
sizeof(struct io_thread_req *),
@@ -1103,7 +1103,7 @@ static int __init ubd_init(void)
if (io_req_buffer == NULL) {
printk(KERN_ERR "Failed to initialize ubd buffering\n");
- return -1;
+ return -ENOMEM;
}
platform_driver_register(&ubd_driver);
mutex_lock(&ubd_lock);