Commit 8d1b80a7 authored by Dan Carpenter's avatar Dan Carpenter Committed by Gao Xiang

erofs: fix an error code in z_erofs_init_zip_subsystem()

Return -ENOMEM if alloc_workqueue() fails.  Don't return success.

Fixes: d8a650adf429 ("erofs: add per-cpu threads for decompression as an option")
Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Reviewed-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/Y+4d0FRsUq8jPoOu@kiliSigned-off-by: default avatarGao Xiang <hsiangkao@linux.alibaba.com>
parent 61fef989
......@@ -475,8 +475,10 @@ int __init z_erofs_init_zip_subsystem(void)
z_erofs_workqueue = alloc_workqueue("erofs_worker",
WQ_UNBOUND | WQ_HIGHPRI, num_possible_cpus());
if (!z_erofs_workqueue)
if (!z_erofs_workqueue) {
err = -ENOMEM;
goto out_error_workqueue_init;
}
err = erofs_init_percpu_workers();
if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment