[PATCH] efi_loader: Do not show error message if TPM is not present
Michal Simek
michal.simek at xilinx.com
Mon Nov 29 14:06:02 CET 2021
For systems which have TPM support enabled but actual device is missing
there is no reason to show a message that measurement failed.
That's why properly check error code which is returned.
Signed-off-by: Michal Simek <michal.simek at xilinx.com>
---
lib/efi_loader/efi_image_loader.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/lib/efi_loader/efi_image_loader.c b/lib/efi_loader/efi_image_loader.c
index eb95580538cc..c6a254dc25dd 100644
--- a/lib/efi_loader/efi_image_loader.c
+++ b/lib/efi_loader/efi_image_loader.c
@@ -934,8 +934,9 @@ efi_status_t efi_load_pe(struct efi_loaded_image_obj *handle,
#if CONFIG_IS_ENABLED(EFI_TCG2_PROTOCOL)
/* Measure an PE/COFF image */
- if (tcg2_measure_pe_image(efi, efi_size, handle,
- loaded_image_info))
+ ret = tcg2_measure_pe_image(efi, efi_size, handle,
+ loaded_image_info);
+ if (ret && ret != EFI_NOT_FOUND)
log_err("PE image measurement failed\n");
#endif
--
2.33.1
More information about the U-Boot
mailing list