From: Johan Hovold <johan@kernel.org>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org,
Johan Hovold <johan@kernel.org>
Subject: [PATCH 4/4] mmc: vub300: clean up module init
Date: Fri, 27 Mar 2026 11:52:08 +0100 [thread overview]
Message-ID: <20260327105208.1310739-5-johan@kernel.org> (raw)
In-Reply-To: <20260327105208.1310739-1-johan@kernel.org>
Clean up module init by dropping redundant error messages (e.g.
allocation and USB driver registration failure will already have been
logged) and naming error labels after what they do.
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/mmc/host/vub300.c | 33 ++++++++++++++++-----------------
1 file changed, 16 insertions(+), 17 deletions(-)
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index 3057a69ff8c4..6c3cb2f1c9d3 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -2429,37 +2429,36 @@ static int __init vub300_init(void)
pr_info("VUB300 Driver rom wait states = %02X irqpoll timeout = %04X",
firmware_rom_wait_states, 0x0FFFF & firmware_irqpoll_timeout);
+
cmndworkqueue = create_singlethread_workqueue("kvub300c");
- if (!cmndworkqueue) {
- pr_err("not enough memory for the REQUEST workqueue");
- result = -ENOMEM;
- goto out1;
- }
+ if (!cmndworkqueue)
+ return -ENOMEM;
+
pollworkqueue = create_singlethread_workqueue("kvub300p");
if (!pollworkqueue) {
- pr_err("not enough memory for the IRQPOLL workqueue");
result = -ENOMEM;
- goto out2;
+ goto err_destroy_cmdwq;
}
+
deadworkqueue = create_singlethread_workqueue("kvub300d");
if (!deadworkqueue) {
- pr_err("not enough memory for the EXPIRED workqueue");
result = -ENOMEM;
- goto out3;
+ goto err_destroy_pollwq;
}
+
result = usb_register(&vub300_driver);
- if (result) {
- pr_err("usb_register failed. Error number %d", result);
- goto out4;
- }
+ if (result)
+ goto err_destroy_deadwq;
+
return 0;
-out4:
+
+err_destroy_deadwq:
destroy_workqueue(deadworkqueue);
-out3:
+err_destroy_pollwq:
destroy_workqueue(pollworkqueue);
-out2:
+err_destroy_cmdwq:
destroy_workqueue(cmndworkqueue);
-out1:
+
return result;
}
--
2.52.0
prev parent reply other threads:[~2026-03-27 10:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-27 10:52 [PATCH 0/4] mmc: vub300: fix NULL-deref and UAF on disconnect Johan Hovold
2026-03-27 10:52 ` [PATCH 1/4] mmc: vub300: fix NULL-deref " Johan Hovold
2026-03-27 10:52 ` [PATCH 2/4] mmc: vub300: fix use-after-free " Johan Hovold
2026-03-27 10:52 ` [PATCH 3/4] mmc: vub300: rename probe error labels Johan Hovold
2026-03-27 10:52 ` Johan Hovold [this message]
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=20260327105208.1310739-5-johan@kernel.org \
--to=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ulf.hansson@linaro.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