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: <stable@vger.kernel.org> Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Li Heng <liheng40@huawei.com> Link: https://lore.kernel.org/r/1595229738-10087-1-git-send-email-liheng40@huawei.com Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent fa80b28 commit 2ff3c97

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

  • drivers/firmware/efi

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)