From: Ard Biesheuvel <ardb+git@google.com>
To: linux-efi@vger.kernel.org
Cc: Ard Biesheuvel <ardb@kernel.org>, stable@vger.kernel.org
Subject: [PATCH] efi: Don't destroy runtime workqueue on efisubsys_init() failure
Date: Fri, 20 Nov 2026 15:21:24 +0100 [thread overview]
Message-ID: <20261120142123.1125683-2-ardb+git@google.com> (raw)
From: Ard Biesheuvel <ardb@kernel.org>
Commit 98086df8b70c ("efi: add missed destroy_workqueue when
efisubsys_init fails") added a destroy_workqueue(efi_rts_wq) call to the
error cleanup path of efisubsys_init() without clearing
EFI_RUNTIME_SERVICES in efi.flags, leaving __efi_queue_work() passing a
freed workqueue pointer to queue_work() on any subsequent runtime
service call (for instance via the rtc-efi device registered right
before efi_kobj is created).
Furthermore, since commit 13c6da02e767 ("efi: Allocate runtime workqueue
before ACPI init"), efi_rts_wq is no longer allocated by
efisubsys_init() at all, as efipostcore_init() allocates it earlier for
consumers such as ACPI PRM that do not depend on /sys/firmware/efi.
Drop the bogus destroy_workqueue() cleanup from efisubsys_init().
Fixes: 98086df8b70c ("efi: add missed destroy_workqueue when efisubsys_init fails")
Fixes: 13c6da02e767 ("efi: Allocate runtime workqueue before ACPI init")
Cc: stable@vger.kernel.org
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
---
drivers/firmware/efi/efi.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c
index 9bc22de0d67e..40b423f85e06 100644
--- a/drivers/firmware/efi/efi.c
+++ b/drivers/firmware/efi/efi.c
@@ -466,8 +466,7 @@ static int __init efisubsys_init(void)
efi_kobj = kobject_create_and_add("efi", firmware_kobj);
if (!efi_kobj) {
pr_err("efi: Firmware registration failed.\n");
- error = -ENOMEM;
- goto err_destroy_wq;
+ return -ENOMEM;
}
if (IS_ENABLED(CONFIG_PREEMPT_RT) && efi.runtime_supported_mask) {
@@ -525,9 +524,6 @@ static int __init efisubsys_init(void)
err_put:
kobject_put(efi_kobj);
efi_kobj = NULL;
-err_destroy_wq:
- if (efi_rts_wq)
- destroy_workqueue(efi_rts_wq);
return error;
}
--
2.56.1.750.gf70dc682cf-goog
reply other threads:[~2026-11-20 14:21 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20261120142123.1125683-2-ardb+git@google.com \
--to=ardb+git@google.com \
--cc=ardb@kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.