diff options
author | Tom Rini <trini@konsulko.com> | 2022-10-07 11:51:05 -0400 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2022-10-07 11:51:05 -0400 |
commit | 11ef7f07ce60b60fb78c330b3ae35fd1037e50c1 (patch) | |
tree | fbbc12ec51fc3651d5fce002ebf38c76621dac8e /cmd/bootefi.c | |
parent | f5717231abad983b4d8f87db612ae60dec86cb1b (diff) | |
parent | a75e8355eaa561ebd6128c92a90288d5d7c1f060 (diff) |
Merge tag 'efi-2023-01-rc1' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2023-01-rc1
UEFI:
* Provide driver binding protocol to registered events for block devices
* Code simplification and refactoring
* Fix pylint errors in test_efi_secboot
Other:
* Improve checks for register ranges
Diffstat (limited to 'cmd/bootefi.c')
-rw-r--r-- | cmd/bootefi.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/cmd/bootefi.c b/cmd/bootefi.c index 3041873afb..b93c0d3d4c 100644 --- a/cmd/bootefi.c +++ b/cmd/bootefi.c @@ -492,7 +492,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; + efi_status_t ret, ret2; u16 *load_options; if (!bootefi_device_path || !bootefi_image_path) { @@ -509,12 +509,9 @@ efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size) * Make sure that device for device_path exist * in load_image(). Otherwise, shell and grub will fail. */ - ret = efi_create_handle(&mem_handle); - if (ret != EFI_SUCCESS) - goto out; - - ret = efi_add_protocol(mem_handle, &efi_guid_device_path, - file_path); + ret = efi_install_multiple_protocol_interfaces(&mem_handle, + &efi_guid_device_path, + file_path, NULL); if (ret != EFI_SUCCESS) goto out; msg_path = file_path; @@ -542,9 +539,11 @@ efi_status_t efi_run_image(void *source_buffer, efi_uintn_t source_size) ret = do_bootefi_exec(handle, load_options); out: - efi_delete_handle(mem_handle); + ret2 = efi_uninstall_multiple_protocol_interfaces(mem_handle, + &efi_guid_device_path, + file_path, NULL); efi_free_pool(file_path); - return ret; + return (ret != EFI_SUCCESS) ? ret : ret2; } #ifdef CONFIG_CMD_BOOTEFI_SELFTEST |