Commit 98086df8 authored by Li Heng's avatar Li Heng Committed by Ard Biesheuvel

efi: add missed destroy_workqueue when efisubsys_init fails

destroy_workqueue() should be called to destroy efi_rts_wq
when efisubsys_init() init resources fails.

Cc: <stable@vger.kernel.org>
Reported-by: default avatarHulk Robot <hulkci@huawei.com>
Signed-off-by: default avatarLi Heng <liheng40@huawei.com>
Link: https://lore.kernel.org/r/1595229738-10087-1-git-send-email-liheng40@huawei.comSigned-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
parent c8502eb2
...@@ -381,6 +381,7 @@ static int __init efisubsys_init(void) ...@@ -381,6 +381,7 @@ static int __init efisubsys_init(void)
efi_kobj = kobject_create_and_add("efi", firmware_kobj); efi_kobj = kobject_create_and_add("efi", firmware_kobj);
if (!efi_kobj) { if (!efi_kobj) {
pr_err("efi: Firmware registration failed.\n"); pr_err("efi: Firmware registration failed.\n");
destroy_workqueue(efi_rts_wq);
return -ENOMEM; return -ENOMEM;
} }
...@@ -424,6 +425,7 @@ static int __init efisubsys_init(void) ...@@ -424,6 +425,7 @@ static int __init efisubsys_init(void)
generic_ops_unregister(); generic_ops_unregister();
err_put: err_put:
kobject_put(efi_kobj); kobject_put(efi_kobj);
destroy_workqueue(efi_rts_wq);
return error; return error;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment