summaryrefslogtreecommitdiff
path: root/cmd/bootefi.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2017-10-18 18:13:14 +0200
committerAlexander Graf <agraf@suse.de>2017-12-01 13:22:55 +0100
commitc2b53902ca28bc3a90861067af6fffeae6e5ead0 (patch)
treee87e517021b465d69efa76d439c6c86e072e42be /cmd/bootefi.c
parentd78e40d651972ef061c960e4b7da7843383c2ec9 (diff)
efi_selftest: correctly cleanup after selftest
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 <xypron.glpk@gmx.de> Signed-off-by: Alexander Graf <agraf@suse.de>
Diffstat (limited to 'cmd/bootefi.c')
-rw-r--r--cmd/bootefi.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c
index b894403ff6..0915192bbb 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();
free(loaded_image_info.load_options);
- return r;
+ list_del(&loaded_image_info_obj.link);
+ return r != EFI_SUCCESS;
} else
#endif
if (!strcmp(argv[1], "bootmgr")) {