From 5004cc655730355d681b333ff5eafd62a4ee02f2 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 16 Feb 2023 15:13:04 +0300 Subject: [PATCH] UPSTREAM: 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") Bug: 267533689 Tests: launch_cvd Change-Id: I49dcf8094655db47ac71ae8967b5402373fc7adc Signed-off-by: Dan Carpenter Reviewed-by: Gao Xiang Link: https://lore.kernel.org/r/Y+4d0FRsUq8jPoOu@kili Signed-off-by: Gao Xiang (cherry picked from commit 8d1b80a79452630f157bf634ae9cfcd9f4eed161) Signed-off-by: Sandeep Dhavale --- fs/erofs/zdata.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c index 4db8a858da37..3af123b7633d 100644 --- a/fs/erofs/zdata.c +++ b/fs/erofs/zdata.c @@ -329,8 +329,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)