Commit b94b19e7 authored by Tom Rini's avatar Tom Rini

Merge tag 'efi-2019-04-rc5' of git://git.denx.de/u-boot-efi

Pull request for UEFI system for v2019.04-rc5

A bunch of small fixes. The major ones being

- avoid illegal memory access in efi_allocate_pool() on 32 bit systems
- avoid endless loop in HII protocol
parents 3d7891d3 d0bd8761
......@@ -80,7 +80,6 @@ static void efi_dump_single_var(u16 *name, efi_guid_t *guid)
printf(", DataSize = 0x%zx\n", size);
print_hex_dump(" ", DUMP_PREFIX_OFFSET, 16, 1, data, size, true);
return;
out:
free(data);
}
......
......@@ -1581,10 +1581,8 @@ efi_status_t efi_setup_loaded_image(struct efi_device_path *device_path,
goto failure;
#endif
if (info_ptr)
*info_ptr = info;
if (handle_ptr)
*handle_ptr = obj;
*info_ptr = info;
*handle_ptr = obj;
return ret;
failure:
......
......@@ -226,7 +226,7 @@ static efi_status_t EFIAPI efi_file_open(struct efi_file_handle *file,
efi_status_t ret;
EFI_ENTRY("%p, %p, \"%ls\", %llx, %llu", file, new_handle,
(wchar_t *)file_name, open_mode, attributes);
file_name, open_mode, attributes);
/* Check parameters */
if (!file || !new_handle || !file_name) {
......
......@@ -227,9 +227,8 @@ out:
error:
if (stbl) {
free(stbl->language);
if (idx > 0)
while (--idx >= 0)
free(stbl->strings[idx].string);
while (idx > 0)
free(stbl->strings[--idx].string);
free(stbl->strings);
}
free(stbl);
......
......@@ -440,6 +440,7 @@ efi_status_t efi_free_pages(uint64_t memory, efi_uintn_t pages)
efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size, void **buffer)
{
efi_status_t r;
u64 addr;
struct efi_pool_allocation *alloc;
u64 num_pages = efi_size_in_pages(size +
sizeof(struct efi_pool_allocation));
......@@ -453,9 +454,9 @@ efi_status_t efi_allocate_pool(int pool_type, efi_uintn_t size, void **buffer)
}
r = efi_allocate_pages(EFI_ALLOCATE_ANY_PAGES, pool_type, num_pages,
(uint64_t *)&alloc);
&addr);
if (r == EFI_SUCCESS) {
alloc = (struct efi_pool_allocation *)(uintptr_t)addr;
alloc->num_pages = num_pages;
*buffer = alloc->data;
}
......
......@@ -335,7 +335,7 @@ efi_status_t EFIAPI efi_get_next_variable_name(efi_uintn_t *variable_name_size,
EFI_ENTRY("%p \"%ls\" %pUl", variable_name_size, variable_name, vendor);
if (!variable_name_size || !variable_name || !vendor)
EFI_EXIT(EFI_INVALID_PARAMETER);
return EFI_EXIT(EFI_INVALID_PARAMETER);
if (variable_name[0]) {
/* check null-terminated string */
......
......@@ -783,19 +783,10 @@ static int test_hii_string_get_string(void)
goto out;
}
#if 1
u16 *c1, *c2;
for (c1 = string, c2 = L"Japanese"; *c1 == *c2; c1++, c2++)
;
if (!*c1 && !*c2)
result = EFI_ST_SUCCESS;
else
result = EFI_ST_FAILURE;
#else
/* TODO: %ls */
efi_st_printf("got string is %s (can be wrong)\n", string);
#endif
if (efi_st_strcmp_16_8(string, "Japanese")) {
efi_st_error("get_string returned incorrect string\n");
goto out;
}
result = EFI_ST_SUCCESS;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment