linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Li Heng <liheng40@huawei.com>, linux-efi@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org,
	Ard Biesheuvel <ardb@kernel.org>,
	Rui Xiang <rui.xiang@huawei.com>
Subject: Re: [PATCH] efi: add missed destroy_workqueue when efisubsys_init fails
Date: Thu, 23 Jul 2020 08:28:26 +0200	[thread overview]
Message-ID: <9255e38a-e5fb-0a41-1b6d-5fe4226e3b42@web.de> (raw)

> 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

             reply	other threads:[~2020-07-23  6:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-23  6:28 Markus Elfring [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-07-20  7:22 [PATCH] efi: add missed destroy_workqueue when efisubsys_init fails Li Heng

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9255e38a-e5fb-0a41-1b6d-5fe4226e3b42@web.de \
    --to=markus.elfring@web.de \
    --cc=ardb@kernel.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=liheng40@huawei.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rui.xiang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).