Linux-EROFS Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Sandeep Dhavale <dhavale@google.com>
Cc: kernel-janitors@vger.kernel.org, linux-erofs@lists.ozlabs.org,
	Yue Hu <huyue2@coolpad.com>
Subject: [PATCH] erofs: fix an error code in z_erofs_init_zip_subsystem()
Date: Thu, 16 Feb 2023 15:13:04 +0300	[thread overview]
Message-ID: <Y+4d0FRsUq8jPoOu@kili> (raw)

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: Dan Carpenter <error27@gmail.com>
---
 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 8ea3f5fe985e..3247d2422bea 100644
--- a/fs/erofs/zdata.c
+++ b/fs/erofs/zdata.c
@@ -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)
-- 
2.39.1


             reply	other threads:[~2023-02-16 12:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-16 12:13 Dan Carpenter [this message]
2023-02-16 12:14 ` [PATCH] erofs: fix an error code in z_erofs_init_zip_subsystem() Gao Xiang
2023-02-17  1:41 ` Yue Hu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+4d0FRsUq8jPoOu@kili \
    --to=error27@gmail.com \
    --cc=dhavale@google.com \
    --cc=huyue2@coolpad.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-erofs@lists.ozlabs.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox