From: Ard Biesheuvel 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 --- 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