From: Alexander Graf Date: Wed, 8 Nov 2017 15:40:50 +0100 Subject: [U-Boot] [PATCH v4 12/18] efi_selftest: correctly cleanup after selftest In-Reply-To: <20171018161320.7231-13-xypron.glpk@gmx.de> References: <20171018161320.7231-1-xypron.glpk@gmx.de> <20171018161320.7231-13-xypron.glpk@gmx.de> Message-ID: <5516a318-37d8-c034-49da-a0149d167bf0@suse.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 10/18/2017 06:13 PM, Heinrich Schuchardt wrote: > After executing bootefi selftest > * restore GD > * unlink the load image handle > * return 0 or 1 and not a truncated efi_status_t. > > Signed-off-by: Heinrich Schuchardt > --- > v4 > no change > v3 > new patch split off > --- > cmd/bootefi.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/cmd/bootefi.c b/cmd/bootefi.c > index 18331536dd..40834f3899 100644 > --- a/cmd/bootefi.c > +++ b/cmd/bootefi.c > @@ -349,8 +349,10 @@ static int do_bootefi(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) > set_load_options(&loaded_image_info, "efi_selftest"); > /* Execute the test */ > r = efi_selftest(&loaded_image_info, &systab); > + efi_restore_gd(); Why don't we have to restore gd on normal efi binaries? Because Exit() is doing that for us? In that case, why not call efi_selftest() through efi_do_enter()? That should give you the exit call for free ;) Alex