aboutsummaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2024-03-21 08:35:23 -0400
committerTom Rini <trini@konsulko.com>2024-03-21 08:35:23 -0400
commit5397daaed8994000f2b3480896df9c163dea4375 (patch)
tree21671fe2a0f3ff4fbeda01be16060406004d93d5 /lib/efi_loader
parent6ec096a7116a5f1f7dfac5f69ef192429331905c (diff)
parentfcd0c8b8474f7db0b94608424715a73fbeba92dc (diff)
Merge tag 'efi-2024-04-rc5-2' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request efi-2024-04-rc5-2 Documentation: * patman: Properly document the patchwork_url setting * doc: man-page for if * colibri-imx8x, apalis-imx8: update board documentation UEFI: * correct handling of EFI binary return code * don't show usage help if EFI binary fails. * correct error handling for bootefi selftest command
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/efi_bootbin.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/efi_loader/efi_bootbin.c b/lib/efi_loader/efi_bootbin.c
index 733cc1a61b..b7910f78fb 100644
--- a/lib/efi_loader/efi_bootbin.c
+++ b/lib/efi_loader/efi_bootbin.c
@@ -125,7 +125,7 @@ efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size)
efi_handle_t mem_handle = NULL, handle;
struct efi_device_path *file_path = NULL;
struct efi_device_path *msg_path;
- efi_status_t ret, ret2;
+ efi_status_t ret;
u16 *load_options;
if (!bootefi_device_path || !bootefi_image_path) {
@@ -172,11 +172,17 @@ efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size)
ret = do_bootefi_exec(handle, load_options);
out:
- ret2 = efi_uninstall_multiple_protocol_interfaces(mem_handle,
- &efi_guid_device_path,
- file_path, NULL);
+ if (mem_handle) {
+ efi_status_t r;
+
+ r = efi_uninstall_multiple_protocol_interfaces(
+ mem_handle, &efi_guid_device_path, file_path, NULL);
+ if (r != EFI_SUCCESS)
+ log_err("Uninstalling protocol interfaces failed\n");
+ }
efi_free_pool(file_path);
- return (ret != EFI_SUCCESS) ? ret : ret2;
+
+ return ret;
}
/**