summaryrefslogtreecommitdiff
path: root/cmd/efidebug.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-01-23 19:07:00 -0500
committerTom Rini <trini@konsulko.com>2021-01-23 19:07:00 -0500
commit69d29fe1c0aeb33f42633a75555d30b7921c02aa (patch)
treeb3b960b8e0b89202e0f8389efc4c79bdc3299a49 /cmd/efidebug.c
parente716c9022970dac9be15856a6651a07132463578 (diff)
parent8d0949b3ed6985377682d7ec260be07ef26ef6d4 (diff)
Merge tag 'efi-2021-04-rc1-3' of https://gitlab.denx.de/u-boot/custodians/u-boot-efi
Pull request for UEFI sub-system for efi-2021-04-rc1-3 Bug fixes for UEFI sub-system: * correct value of EFI_BLOCK_IO_PROTOCOL.Media.LastBlock * correct GUID when closing of EFI_LOAD_FILE_PROTOCOL * error handling in mkeficapsule tool Bug fixes for FAT file system: * consistent error handling for flush dir()
Diffstat (limited to 'cmd/efidebug.c')
-rw-r--r--cmd/efidebug.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/cmd/efidebug.c b/cmd/efidebug.c
index 9a2d4ddd5ef..83bc2196a5a 100644
--- a/cmd/efidebug.c
+++ b/cmd/efidebug.c
@@ -189,14 +189,16 @@ static int do_efi_capsule_res(struct cmd_tbl *cmdtp, int flag,
ret = EFI_CALL(RT->get_variable(var_name16, &guid, NULL, &size, NULL));
if (ret == EFI_BUFFER_TOO_SMALL) {
result = malloc(size);
+ if (!result)
+ return CMD_RET_FAILURE;
ret = EFI_CALL(RT->get_variable(var_name16, &guid, NULL, &size,
result));
- if (ret != EFI_SUCCESS) {
- free(result);
- printf("Failed to get %ls\n", var_name16);
+ }
+ if (ret != EFI_SUCCESS) {
+ free(result);
+ printf("Failed to get %ls\n", var_name16);
- return CMD_RET_FAILURE;
- }
+ return CMD_RET_FAILURE;
}
printf("Result total size: 0x%x\n", result->variable_total_size);