linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Jia-Ju Bai <baijiaju1990@gmail.com>
Cc: matt@codeblueprint.co.uk, ard.biesheuvel@linaro.org,
	tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	x86@kernel.org, linux-efi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86: efi: Replace GFP_ATOMIC with GFP_KERNEL in efi_query_variable_store
Date: Tue, 13 Feb 2018 19:07:08 +0100	[thread overview]
Message-ID: <20180213180707.einsznaoghtctkqn@gmail.com> (raw)
In-Reply-To: <1516847386-5291-1-git-send-email-baijiaju1990@gmail.com>


* Jia-Ju Bai <baijiaju1990@gmail.com> wrote:

> The function kzalloc here is not called in atomic context.
> If nonblocking in efi_query_variable_store is true, 
> namely it is in atomic context, efi_query_variable_store will return before
> this kzalloc is called.
> Thus GFP_ATOMIC is not necessary, and it can be replaced with GFP_KERNEL.
> 
> This is found by a static analysis tool named DCNS written by myself.
> 
> Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com>
> ---
>  arch/x86/platform/efi/quirks.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
> index 8a99a2e..b6dcb52 100644
> --- a/arch/x86/platform/efi/quirks.c
> +++ b/arch/x86/platform/efi/quirks.c
> @@ -177,7 +177,7 @@ efi_status_t efi_query_variable_store(u32 attributes, unsigned long size,
>  		 * that by attempting to use more space than is available.
>  		 */
>  		unsigned long dummy_size = remaining_size + 1024;
> -		void *dummy = kzalloc(dummy_size, GFP_ATOMIC);
> +		void *dummy = kzalloc(dummy_size, GFP_KERNEL);

Looks good to me!

Reviewed-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

  parent reply	other threads:[~2018-02-13 18:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-25  2:29 [PATCH] x86: efi: Replace GFP_ATOMIC with GFP_KERNEL in efi_query_variable_store Jia-Ju Bai
2018-01-25  2:49 ` Joe Perches
2018-02-13 18:07 ` Ingo Molnar [this message]
2018-02-13 18:40   ` Ard Biesheuvel

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=20180213180707.einsznaoghtctkqn@gmail.com \
    --to=mingo@kernel.org \
    --cc=ard.biesheuvel@linaro.org \
    --cc=baijiaju1990@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matt@codeblueprint.co.uk \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /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).