summaryrefslogtreecommitdiff
path: root/lib/efi_loader
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2021-04-24 09:27:49 -0400
committerTom Rini <[email protected]>2021-04-24 09:27:49 -0400
commitc93ac8ff0b40ad3c8c5b2728c9a9e5dbd2247679 (patch)
treeffa9b791946b1014bb5438be559f48caccded77f /lib/efi_loader
parent84baa65dffdbce20752279101548ba888be53b3e (diff)
parentce62b0f8f45f1b71fc03ddee84c0529cea228e24 (diff)
Merge tag 'efi-2021-07-rc1-3' of https://source.denx.de/u-boot/custodians/u-boot-efi
Pull request for efi-2021-07-rc1-3 Documentation fixes UEFI bug fixes: * error handling for capsule updates
Diffstat (limited to 'lib/efi_loader')
-rw-r--r--lib/efi_loader/efi_capsule.c4
-rw-r--r--lib/efi_loader/efi_string.c1
-rw-r--r--lib/efi_loader/efi_tcg2.c5
3 files changed, 4 insertions, 6 deletions
diff --git a/lib/efi_loader/efi_capsule.c b/lib/efi_loader/efi_capsule.c
index 691eda5e0d1..6ee883d5b11 100644
--- a/lib/efi_loader/efi_capsule.c
+++ b/lib/efi_loader/efi_capsule.c
@@ -481,7 +481,6 @@ efi_status_t EFIAPI efi_update_capsule(
if (ret != EFI_SUCCESS)
goto out;
}
-out:
if (IS_ENABLED(CONFIG_EFI_ESRT)) {
/* Rebuild the ESRT to reflect any updated FW images. */
@@ -489,6 +488,7 @@ out:
if (ret != EFI_SUCCESS)
log_warning("EFI Capsule: failed to update ESRT\n");
}
+out:
return EFI_EXIT(ret);
}
@@ -685,7 +685,6 @@ skip:
efi_free_pool(boot_dev);
boot_dev = NULL;
}
-out:
if (boot_dev) {
u16 *path_str;
@@ -703,6 +702,7 @@ out:
} else {
ret = EFI_NOT_FOUND;
}
+out:
free(boot_order);
return ret;
diff --git a/lib/efi_loader/efi_string.c b/lib/efi_loader/efi_string.c
index 96272422886..a3b8edf5a80 100644
--- a/lib/efi_loader/efi_string.c
+++ b/lib/efi_loader/efi_string.c
@@ -7,6 +7,7 @@
#include <common.h>
#include <charset.h>
+#include <efi_loader.h>
/**
* efi_create_indexed_name - create a string name with an index
diff --git a/lib/efi_loader/efi_tcg2.c b/lib/efi_loader/efi_tcg2.c
index d5eca68769b..94e8f22bbb6 100644
--- a/lib/efi_loader/efi_tcg2.c
+++ b/lib/efi_loader/efi_tcg2.c
@@ -535,30 +535,27 @@ static efi_status_t tcg2_create_digest(const u8 *input, u32 length,
sha1_starts(&ctx);
sha1_update(&ctx, input, length);
sha1_finish(&ctx, final);
- digest_list->count++;
break;
case TPM2_ALG_SHA256:
sha256_starts(&ctx_256);
sha256_update(&ctx_256, input, length);
sha256_finish(&ctx_256, final);
- digest_list->count++;
break;
case TPM2_ALG_SHA384:
sha384_starts(&ctx_512);
sha384_update(&ctx_512, input, length);
sha384_finish(&ctx_512, final);
- digest_list->count++;
break;
case TPM2_ALG_SHA512:
sha512_starts(&ctx_512);
sha512_update(&ctx_512, input, length);
sha512_finish(&ctx_512, final);
- digest_list->count++;
break;
default:
EFI_PRINT("Unsupported algorithm %x\n", hash_alg);
return EFI_INVALID_PARAMETER;
}
+ digest_list->count++;
digest_list->digests[i].hash_alg = hash_alg;
memcpy(&digest_list->digests[i].digest, final, (u32)alg_to_len(hash_alg));
}