lkml.org 
[lkml]   [2020]   [Jul]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] efi: add missed destroy_workqueue when efisubsys_init fails
From
Date
> destroy_workqueue() should be called to destroy efi_rts_wq
> when efisubsys_init() init resources fails.

* Can such exception handling depend on the data structure member “efi.runtime_supported_mask”?

* An imperative wording would be preferred for the change description
(besides another bit of fine-tuning), wouldn't it?

* Will the tag “Fixes” become helpful for the commit message?



> +++ b/drivers/firmware/efi/efi.c
> @@ -379,6 +379,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");
> + destroy_workqueue(efi_rts_wq);
> return -ENOMEM;
> }

How do you think about to use the following statements instead
in the if branch?

- return -ENOMEM;
+ error = -ENOMEM;
+ goto destroy_workqueue;


Regards,
Markus

\
 
 \ /
  Last update: 2020-07-23 08:29    [W:0.022 / U:0.728 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site