Skip to content

Commit 2ff3c97

Browse files
Li Henggregkh
authored andcommitted
efi: add missed destroy_workqueue when efisubsys_init fails
commit 98086df upstream. destroy_workqueue() should be called to destroy efi_rts_wq when efisubsys_init() init resources fails. Cc: <[email protected]> Reported-by: Hulk Robot <[email protected]> Signed-off-by: Li Heng <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent fa80b28 commit 2ff3c97

File tree

1 file changed

+2
-0
lines changed
  • drivers/firmware/efi

1 file changed

+2
-0
lines changed

drivers/firmware/efi/efi.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,7 @@ static int __init efisubsys_init(void)
359359
efi_kobj = kobject_create_and_add("efi", firmware_kobj);
360360
if (!efi_kobj) {
361361
pr_err("efi: Firmware registration failed.\n");
362+
destroy_workqueue(efi_rts_wq);
362363
return -ENOMEM;
363364
}
364365

@@ -395,6 +396,7 @@ static int __init efisubsys_init(void)
395396
generic_ops_unregister();
396397
err_put:
397398
kobject_put(efi_kobj);
399+
destroy_workqueue(efi_rts_wq);
398400
return error;
399401
}
400402

0 commit comments

Comments
 (0)