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/nvedit_efi.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/nvedit_efi.c')
-rw-r--r-- | cmd/nvedit_efi.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/cmd/nvedit_efi.c b/cmd/nvedit_efi.c index 770877c527..24944ab81e 100644 --- a/cmd/nvedit_efi.c +++ b/cmd/nvedit_efi.c @@ -382,8 +382,7 @@ int do_env_set_efi(struct cmd_tbl *cmdtp, int flag, int argc, efi_guid_t guid; u32 attributes; bool default_guid, verbose, value_on_memory; - u16 *var_name16 = NULL, *p; - size_t len; + u16 *var_name16; efi_status_t ret; if (argc == 1) @@ -487,18 +486,15 @@ int do_env_set_efi(struct cmd_tbl *cmdtp, int flag, int argc, 16, 1, value, size, true); } - len = utf8_utf16_strnlen(var_name, strlen(var_name)); - var_name16 = malloc((len + 1) * 2); + var_name16 = efi_convert_string(var_name); if (!var_name16) { printf("## Out of memory\n"); ret = CMD_RET_FAILURE; goto out; } - p = var_name16; - utf8_utf16_strncpy(&p, var_name, len + 1); - ret = efi_set_variable_int(var_name16, &guid, attributes, size, value, true); + free(var_name16); unmap_sysmem(value); if (ret == EFI_SUCCESS) { ret = CMD_RET_SUCCESS; @@ -533,7 +529,6 @@ out: unmap_sysmem(value); else free(value); - free(var_name16); return ret; } |