From: Ard Biesheuvel <ardb@kernel.org>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: linux-efi <linux-efi@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] efi/libstub: simplify efi_get_memory_map()
Date: Mon, 17 Feb 2020 09:37:46 +0100 [thread overview]
Message-ID: <CAKv+Gu_zevqzHRPMQaEcAeLPCYrTCLtbTbrZ2Ajz+ooYDb3m3A@mail.gmail.com> (raw)
In-Reply-To: <20200216184050.3100-1-xypron.glpk@gmx.de>
On Sun, 16 Feb 2020 at 19:40, Heinrich Schuchardt <xypron.glpk@gmx.de> wrote:
>
> Do not check the value of status twice.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Thanks, I'll queue this one as well.
> ---
> drivers/firmware/efi/libstub/mem.c | 13 +++++++------
> 1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/firmware/efi/libstub/mem.c b/drivers/firmware/efi/libstub/mem.c
> index c6a784ed640f..c25fd9174b74 100644
> --- a/drivers/firmware/efi/libstub/mem.c
> +++ b/drivers/firmware/efi/libstub/mem.c
> @@ -52,13 +52,14 @@ efi_status_t efi_get_memory_map(struct efi_boot_memmap *map)
> goto again;
> }
>
> - if (status != EFI_SUCCESS)
> + if (status == EFI_SUCCESS) {
> + if (map->key_ptr)
> + *map->key_ptr = key;
> + if (map->desc_ver)
> + *map->desc_ver = desc_version;
> + } else {
> efi_bs_call(free_pool, m);
> -
> - if (map->key_ptr && status == EFI_SUCCESS)
> - *map->key_ptr = key;
> - if (map->desc_ver && status == EFI_SUCCESS)
> - *map->desc_ver = desc_version;
> + }
>
> fail:
> *map->map = m;
> --
> 2.25.0
>
prev parent reply other threads:[~2020-02-17 8:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-16 18:40 [PATCH 1/1] efi/libstub: simplify efi_get_memory_map() Heinrich Schuchardt
2020-02-17 8:37 ` Ard Biesheuvel [this message]
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=CAKv+Gu_zevqzHRPMQaEcAeLPCYrTCLtbTbrZ2Ajz+ooYDb3m3A@mail.gmail.com \
--to=ardb@kernel.org \
--cc=linux-efi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xypron.glpk@gmx.de \
/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).