diff options
author | Tom Rini <trini@konsulko.com> | 2024-12-05 08:10:51 -0600 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2024-12-05 08:10:51 -0600 |
commit | ac3428fcc7b93787c07fa69ff915ba17c643c8f9 (patch) | |
tree | a794e67bd9124e280768fe61551f0b1229ec10ac /lib | |
parent | f96e5133184aac377b54bd61f8abf78710f2ee56 (diff) | |
parent | 1d9aa4a283daa1e609130b5457c9857d62f1d1cb (diff) |
Merge tag 'efi-master-05122024' of https://source.denx.de/u-boot/custodians/u-boot-tpm
CI: https://source.denx.de/u-boot/custodians/u-boot-tpm/-/pipelines/23719
Two fixes for the EFI subsystem coming via the TPM tree as agreed by Heinrich
The LMB patch fixes a failure in SystemReady testing. Nothing bad happens
without the patch in the device operation, but the return values are wrong
and SCT tests fail for MemoryAllocationServicesTest category.
The second is a shielding the device against mistakes in the definition of
struct fields needed by the capsule update mechanism. Instead of crashing,
print a humna readable message of what's wrong.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/efi_loader/efi_firmware.c | 4 | ||||
-rw-r--r-- | lib/lmb.c | 9 |
2 files changed, 4 insertions, 9 deletions
diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c index 6650c2b8071..112775daf4c 100644 --- a/lib/efi_loader/efi_firmware.c +++ b/lib/efi_loader/efi_firmware.c @@ -281,6 +281,10 @@ static efi_status_t efi_gen_capsule_guids(void) } for (i = 0; i < update_info.num_images; i++) { + if (!fw_array[i].fw_name) { + log_err("fw_name is not defined. Not generating capsule GUIDs\n"); + return EFI_INVALID_PARAMETER; + } gen_v5_guid(&namespace, &fw_array[i].image_type_id, compatible, strlen(compatible), diff --git a/lib/lmb.c b/lib/lmb.c index 14b9b8466ff..3a765c11bee 100644 --- a/lib/lmb.c +++ b/lib/lmb.c @@ -201,15 +201,6 @@ static long lmb_add_region_flags(struct alist *lmb_rgn_lst, phys_addr_t base, phys_addr_t rgnbase = rgn[i].base; phys_size_t rgnsize = rgn[i].size; phys_size_t rgnflags = rgn[i].flags; - phys_addr_t end = base + size - 1; - phys_addr_t rgnend = rgnbase + rgnsize - 1; - if (rgnbase <= base && end <= rgnend) { - if (flags == rgnflags) - /* Already have this region, so we're done */ - return 0; - else - return -1; /* regions with new flags */ - } ret = lmb_addrs_adjacent(base, size, rgnbase, rgnsize); if (ret > 0) { |