diff options
author | Tom Rini <trini@konsulko.com> | 2019-05-03 07:10:17 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2019-05-03 07:10:17 -0400 |
commit | 6e25cfe9a475e8177bad7d9f97cffead6aab6b0d (patch) | |
tree | 2a74f7339892266a8d1d9afd812e9dad38ba0593 /lib/efi_selftest/efi_selftest_startimage_exit.c | |
parent | 3570ea1f98229dc8c166dfc2693510db9167f7f8 (diff) | |
parent | 4ccf678f37731d8ec09eae8dca5f4cbe84132a52 (diff) |
Merge tag 'efi-2019-07-rc2' of git://git.denx.de/u-boot-efi
Pull request for UEFI sub-system for v2019.07-rc2
This pull request provides error fixes for the handling of GPT partitions
and for the UEFI subsystem.
Diffstat (limited to 'lib/efi_selftest/efi_selftest_startimage_exit.c')
-rw-r--r-- | lib/efi_selftest/efi_selftest_startimage_exit.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/efi_selftest/efi_selftest_startimage_exit.c b/lib/efi_selftest/efi_selftest_startimage_exit.c index fa4b7d4a9b..96049dea86 100644 --- a/lib/efi_selftest/efi_selftest_startimage_exit.c +++ b/lib/efi_selftest/efi_selftest_startimage_exit.c @@ -123,6 +123,9 @@ static int execute(void) { efi_status_t ret; efi_handle_t handle; + efi_uintn_t exit_data_size = 0; + u16 *exit_data = NULL; + u16 expected_text[] = EFI_ST_SUCCESS_STR; ret = boottime->load_image(false, image_handle, NULL, image, img.length, &handle); @@ -130,11 +133,21 @@ static int execute(void) efi_st_error("Failed to load image\n"); return EFI_ST_FAILURE; } - ret = boottime->start_image(handle, NULL, NULL); + ret = boottime->start_image(handle, &exit_data_size, &exit_data); if (ret != EFI_UNSUPPORTED) { efi_st_error("Wrong return value from application\n"); return EFI_ST_FAILURE; } + if (!exit_data || exit_data_size != sizeof(expected_text) || + efi_st_memcmp(exit_data, expected_text, sizeof(expected_text))) { + efi_st_error("Incorrect exit data\n"); + return EFI_ST_FAILURE; + } + ret = boottime->free_pool(exit_data); + if (ret != EFI_SUCCESS) { + efi_st_error("Failed to free exit data\n"); + return EFI_ST_FAILURE; + } return EFI_ST_SUCCESS; } |