diff options
| author | Heinrich Schuchardt <[email protected]> | 2023-03-19 09:20:23 +0100 |
|---|---|---|
| committer | Heinrich Schuchardt <[email protected]> | 2023-03-25 11:06:35 +0100 |
| commit | bace47a59d2f6a60972a388d6be034ce20e92270 (patch) | |
| tree | 9d7d546c6330d6e4e75f3235749966f6704d961f /lib | |
| parent | f606fab8dada798da801684bd6f53ddfb50494e2 (diff) | |
efi_loader: simplify efi_str_to_u16()
Use efi_alloc() to allocate memory.
Signed-off-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/efi_loader/efi_device_path_to_text.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/efi_loader/efi_device_path_to_text.c b/lib/efi_loader/efi_device_path_to_text.c index 4b2ade3803f..8c76d8be605 100644 --- a/lib/efi_loader/efi_device_path_to_text.c +++ b/lib/efi_loader/efi_device_path_to_text.c @@ -32,11 +32,10 @@ static u16 *efi_str_to_u16(char *str) { efi_uintn_t len; u16 *out, *dst; - efi_status_t ret; len = sizeof(u16) * (utf8_utf16_strlen(str) + 1); - ret = efi_allocate_pool(EFI_BOOT_SERVICES_DATA, len, (void **)&out); - if (ret != EFI_SUCCESS) + out = efi_alloc(len); + if (!out) return NULL; dst = out; utf8_utf16_strcpy(&dst, str); |
