U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Ilias Apalodimas <ilias.apalodimas@linaro.org>
To: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Cc: Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Shantur Rathore <i@shantur.com>, Bin Meng <bmeng@tinylab.org>,
	AKASHI Takahiro <akashi.tkhro@gmail.com>,
	Masahisa Kojima <kojima.masahisa@socionext.com>,
	Raymond Mao <raymond.mao@linaro.org>,
	Mark Kettenis <kettenis@openbsd.org>,
	Joao Marcos Costa <jmcosta944@gmail.com>,
	u-boot@lists.denx.de
Subject: Re: [RFC 09/14] efi_loader: do not install dtb if bootmgr fails
Date: Wed, 22 May 2024 09:27:43 +0300	[thread overview]
Message-ID: <Zk2QXzEAGeFOmg59@hera> (raw)
In-Reply-To: <Zk2N5-lqV1y7lZVv@hera>

On Wed, May 22, 2024 at 09:17:11AM +0300, Ilias Apalodimas wrote:
> On Fri, Apr 26, 2024 at 04:13:16PM +0200, Heinrich Schuchardt wrote:
> > If the UEFI boot manager fails there is no point in installing the
> > device-tree as a configuration table.
> >
> > Unload image if device-tree cannot be installed.
> >
> > Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> > ---
> >  lib/efi_loader/efi_bootmgr.c | 14 ++++++++++----
> >  1 file changed, 10 insertions(+), 4 deletions(-)
> >
> > diff --git a/lib/efi_loader/efi_bootmgr.c b/lib/efi_loader/efi_bootmgr.c
> > index c64cbe82402..d924810a94b 100644
> > --- a/lib/efi_loader/efi_bootmgr.c
> > +++ b/lib/efi_loader/efi_bootmgr.c
> > @@ -1209,15 +1209,21 @@ efi_status_t efi_bootmgr_run(void *fdt)
> >  		return CMD_RET_FAILURE;
> >  	}
> >
> > -	ret = efi_install_fdt(fdt);
> > -	if (ret != EFI_SUCCESS)
> > -		return ret;
> > -
> >  	ret = efi_bootmgr_load(&handle, &load_options);
> >  	if (ret != EFI_SUCCESS) {
> >  		log_notice("EFI boot manager: Cannot load any image\n");
> >  		return ret;
> >  	}
> >
> > +	ret = efi_install_fdt(fdt);
> > +	if (ret != EFI_SUCCESS) {
> > +		if (EFI_CALL(efi_unload_image(*handle)) == EFI_SUCCESS)

I missed this during the review. This should be efi_unload_image(handle)

With this fixed
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>

> > +			free(load_options);
> > +		else
> > +			log_err("Unloading image failed\n");
> > +
> > +		return ret;
> > +	}
> > +
> >  	return do_bootefi_exec(handle, load_options);
> >  }
> > --
> > 2.43.0
> >
>
>

  reply	other threads:[~2024-05-22  6:27 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-26 14:13 [RFC 00/14] efi_loader: improve device-tree loading Heinrich Schuchardt
2024-04-26 14:13 ` [RFC 01/14] efi_loader: pass GUID by address to efi_dp_from_lo Heinrich Schuchardt
2024-04-26 23:50   ` Ilias Apalodimas
2024-04-26 14:13 ` [RFC 02/14] efi_loader: library function efi_dp_merge Heinrich Schuchardt
2024-04-26 14:30   ` Ilias Apalodimas
2024-04-26 14:52     ` Heinrich Schuchardt
2024-04-26 15:47       ` Ilias Apalodimas
2024-05-14 12:49         ` Heinrich Schuchardt
2024-05-14 12:58           ` Mark Kettenis
2024-05-14 13:08             ` Heinrich Schuchardt
2024-05-22  5:57           ` Ilias Apalodimas
2024-04-26 14:13 ` [RFC 03/14] efi_loader: simplify efi_dp_concat() Heinrich Schuchardt
2024-04-28 13:29   ` Ilias Apalodimas
2024-04-26 14:13 ` [RFC 04/14] cmd: eficonfig: add support for setting fdt Heinrich Schuchardt
2024-04-27 17:21   ` E Shattow
2024-04-27 21:25     ` Heinrich Schuchardt
2024-04-28  4:13       ` E Shattow
2024-04-26 14:13 ` [RFC 05/14] cmd: efidebug: " Heinrich Schuchardt
2024-05-22  6:16   ` Ilias Apalodimas
2024-04-26 14:13 ` [RFC 06/14] efi_loader: superfluous efi_restore_gd after EFI_CALL Heinrich Schuchardt
2024-04-26 14:13 ` [RFC 07/14] cmd: terminate efidebug test bootmgr early on error Heinrich Schuchardt
2024-04-26 14:13 ` [RFC 08/14] efi_loader: improve error handling in try_load_entry() Heinrich Schuchardt
2024-04-26 14:13 ` [RFC 09/14] efi_loader: do not install dtb if bootmgr fails Heinrich Schuchardt
2024-05-22  6:17   ` Ilias Apalodimas
2024-05-22  6:27     ` Ilias Apalodimas [this message]
2024-04-26 14:13 ` [RFC 10/14] efi_loader: load device-tree specified in boot option Heinrich Schuchardt
2024-05-22  6:28   ` Ilias Apalodimas
2024-04-26 14:13 ` [RFC 11/14] efi_loader: move distro_efi_get_fdt_name() Heinrich Schuchardt
2024-04-26 14:52   ` Caleb Connolly
2024-04-26 15:18     ` Heinrich Schuchardt
2024-04-26 14:13 ` [RFC 12/14] efi_loader: return binary from efi_dp_from_lo() Heinrich Schuchardt
2024-04-28 13:28   ` Ilias Apalodimas
2024-05-14 12:57     ` Heinrich Schuchardt
2024-04-26 14:13 ` [RFC 13/14] efi_loader: export efi_load_image_from_path Heinrich Schuchardt
2024-04-28 13:32   ` Ilias Apalodimas
2024-04-26 14:13 ` [RFC 14/14] efi_loader: load distro dtb in bootmgr Heinrich Schuchardt

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=Zk2QXzEAGeFOmg59@hera \
    --to=ilias.apalodimas@linaro.org \
    --cc=akashi.tkhro@gmail.com \
    --cc=bmeng@tinylab.org \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=i@shantur.com \
    --cc=jmcosta944@gmail.com \
    --cc=kettenis@openbsd.org \
    --cc=kojima.masahisa@socionext.com \
    --cc=raymond.mao@linaro.org \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --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