* [PATCH] efi: Don't destroy runtime workqueue on efisubsys_init() failure
@ 2026-11-20 14:21 Ard Biesheuvel
0 siblings, 0 replies; only message in thread
From: Ard Biesheuvel @ 2026-11-20 14:21 UTC (permalink / raw)
To: linux-efi; +Cc: Ard Biesheuvel, stable
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
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-11-20 14:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-20 14:21 [PATCH] efi: Don't destroy runtime workqueue on efisubsys_init() failure Ard Biesheuvel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox