summaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/efi_bootbin.c16
-rw-r--r--lib/efi_loader/efi_helper.c11
-rw-r--r--lib/efi_loader/efi_unicode_collation.c2
3 files changed, 19 insertions, 10 deletions
diff --git a/lib/efi_loader/efi_bootbin.c b/lib/efi_loader/efi_bootbin.c
index 733cc1a61b5..b7910f78fb6 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;
}
/**
diff --git a/lib/efi_loader/efi_helper.c b/lib/efi_loader/efi_helper.c
index 5dd9cc876e4..58761fae784 100644
--- a/lib/efi_loader/efi_helper.c
+++ b/lib/efi_loader/efi_helper.c
@@ -456,11 +456,11 @@ efi_status_t efi_install_fdt(void *fdt)
return EFI_LOAD_ERROR;
}
- /* Create memory reservations as indicated by the device tree */
- efi_carve_out_dt_rsv(fdt);
-
- if (CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE))
+ if (CONFIG_IS_ENABLED(GENERATE_ACPI_TABLE)) {
+ /* Create memory reservations as indicated by the device tree */
+ efi_carve_out_dt_rsv(fdt);
return EFI_SUCCESS;
+ }
/* Prepare device tree for payload */
ret = copy_fdt(&fdt);
@@ -474,6 +474,9 @@ efi_status_t efi_install_fdt(void *fdt)
return EFI_LOAD_ERROR;
}
+ /* Create memory reservations as indicated by the device tree */
+ efi_carve_out_dt_rsv(fdt);
+
efi_try_purge_kaslr_seed(fdt);
if (CONFIG_IS_ENABLED(EFI_TCG2_PROTOCOL_MEASURE_DTB)) {
diff --git a/lib/efi_loader/efi_unicode_collation.c b/lib/efi_loader/efi_unicode_collation.c
index 2b6912c5092..627bb9123cf 100644
--- a/lib/efi_loader/efi_unicode_collation.c
+++ b/lib/efi_loader/efi_unicode_collation.c
@@ -256,7 +256,7 @@ static void EFIAPI efi_fat_to_str(struct efi_unicode_collation_protocol *this,
for (i = 0; i < fat_size; ++i) {
c = (unsigned char)fat[i];
if (c > 0x80)
- c = codepage[c - 0x80];
+ c = codepage[c - 0x60];
string[i] = c;
if (!c)
break;