From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Heinrich Schuchardt <xypron.glpk@gmx.de>
Cc: u-boot@lists.denx.de,
AKASHI Takahiro <takahiro.akashi@linaro.org>,
Alexander Graf <agraf@csgraf.de>
Subject: Re: [PATCH 1/1] efi_loader: efi_dp_from_lo() should skip VenMedia node
Date: Fri, 15 Oct 2021 10:44:09 +0300 [thread overview]
Message-ID: <YWkxSTyW1HLeD8Aw@apalos.home> (raw)
In-Reply-To: <20211015013815.195615-1-xypron.glpk@gmx.de>
On Fri, Oct 15, 2021 at 03:38:15AM +0200, Heinrich Schuchardt wrote:
> The 'efidebug boot dump' command should not display the VenMedia() device
> path node preceding the device path of the initial ram disk.
>
> By letting efi_dp_from_lo() skip the VenMedia() device path node we can
> simplify the coding.
>
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> ---
> lib/efi_loader/efi_device_path.c | 2 +-
> lib/efi_loader/efi_helper.c | 19 +++++--------------
> 2 files changed, 6 insertions(+), 15 deletions(-)
>
> diff --git a/lib/efi_loader/efi_device_path.c b/lib/efi_loader/efi_device_path.c
> index aaf1999d46..7f2aa239de 100644
> --- a/lib/efi_loader/efi_device_path.c
> +++ b/lib/efi_loader/efi_device_path.c
> @@ -1287,7 +1287,7 @@ efi_device_path *efi_dp_from_lo(struct efi_load_option *lo,
>
> vendor = (struct efi_device_path_vendor *)fp;
> if (!guidcmp(&vendor->guid, guid))
> - return efi_dp_dup(fp);
> + return efi_dp_dup(efi_dp_next(fp));
> }
> log_debug("VenMedia(%pUl) not found in %ls\n", &guid, lo->label);
>
> diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c
> index 485384b7ee..b80a6e07df 100644
> --- a/lib/efi_loader/efi_helper.c
> +++ b/lib/efi_loader/efi_helper.c
> @@ -68,10 +68,8 @@ out:
> */
> struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t guid)
> {
> - struct efi_device_path *file_path = NULL;
> - struct efi_device_path *tmp = NULL;
> struct efi_load_option lo;
> - void *var_value = NULL;
> + void *var_value;
> efi_uintn_t size;
> efi_status_t ret;
> u16 var_name[16];
> @@ -86,18 +84,11 @@ struct efi_device_path *efi_get_dp_from_boot(const efi_guid_t guid)
>
> ret = efi_deserialize_load_option(&lo, var_value, &size);
> if (ret != EFI_SUCCESS)
> - goto out;
> -
> - tmp = efi_dp_from_lo(&lo, &guid);
> - if (!tmp)
> - goto out;
> + goto err;
>
> - /* efi_dp_dup will just return NULL if efi_dp_next is NULL */
> - file_path = efi_dp_dup(efi_dp_next(tmp));
> + return efi_dp_from_lo(&lo, &guid);
>
> -out:
> - efi_free_pool(tmp);
> +err:
> free(var_value);
> -
> - return file_path;
> + return NULL;
> }
> --
> 2.30.2
>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
prev parent reply other threads:[~2021-10-15 7:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-15 1:38 [PATCH 1/1] efi_loader: efi_dp_from_lo() should skip VenMedia node Heinrich Schuchardt
2021-10-15 7:44 ` Ilias Apalodimas [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=YWkxSTyW1HLeD8Aw@apalos.home \
--to=ilias.apalodimas@linaro.org \
--cc=agraf@csgraf.de \
--cc=takahiro.akashi@linaro.org \
--cc=u-boot@lists.denx.de \
--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