From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] efi_laoder: Call Exit() on return from payload in StartImage()
Date: Fri, 26 Jan 2018 05:06:56 +0100 [thread overview]
Message-ID: <fadce95d-4754-e708-cf88-eede4b387808@gmx.de> (raw)
In-Reply-To: <20180125235357.36264-1-agraf@suse.de>
On 01/26/2018 12:53 AM, Alexander Graf wrote:
There is a typo in the subject "efi_laoder".
> When a UEFI payload just returns instead of calling the Exit() callback,
> we handle that in efi_do_enter() and call Exit on its behalf, so that
> the loaded_image->exit_status value is correct.
>
> We were missing that logic in StartImage(). Call it there too.
>
> Reported-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
> Signed-off-by: Alexander Graf <agraf@suse.de>
> ---
> lib/efi_loader/efi_boottime.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
> diff --git a/lib/efi_loader/efi_boottime.c b/lib/efi_loader/efi_boottime.c
> index f5dae40f06..4a36b62828 100644
> --- a/lib/efi_loader/efi_boottime.c
> +++ b/lib/efi_loader/efi_boottime.c
> @@ -1578,8 +1578,13 @@ static efi_status_t EFIAPI efi_start_image(efi_handle_t image_handle,
>
> ret = EFI_CALL(entry(image_handle, &systab));
>
> - /* Should usually never get here */
> - return EFI_EXIT(ret);
> + /*
> + * Usually UEFI applications call Exit() instead of returning.
> + * But because the world doesn not consist of ponies and unicorns,
> + * we're happy to emulate that behavior on behalf of a payload
> + * that forgot.
> + */
> + return EFI_CALL(systab.boottime->exit(image_handle, ret, 0, NULL));
> }
>
> /*
>
prev parent reply other threads:[~2018-01-26 4:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-25 23:53 [U-Boot] [PATCH] efi_laoder: Call Exit() on return from payload in StartImage() Alexander Graf
2018-01-26 4:06 ` Heinrich Schuchardt [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=fadce95d-4754-e708-cf88-eede4b387808@gmx.de \
--to=xypron.glpk@gmx.de \
--cc=u-boot@lists.denx.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