summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAlexander Graf <agraf@suse.de>2018-01-26 00:47:53 +0100
committerAlexander Graf <agraf@suse.de>2018-01-28 21:37:13 +0100
commit56672bf52ebf7b9d6de245f7a1bf56679a39093b (patch)
tree51e298424c096ea91c980baa526d77d19c580ed9 /lib
parentc8df80c514908c0370cdaa715a1727532b8f3f6c (diff)
efi_loader: Call Exit() on return from payload in StartImage()
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>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_boottime.c9
1 files 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));
}
/*