REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4700

TpmMeasureAndLogDataWithFlags() computes the measure the code and
log it into PCR 0. TpmMeasureAndLogData() computes the hash for the
configuration. The same "Status" variable is used to store the return
values for both of the functions. There is no error handling if
TpmMeasureAndLogDataWithFlags() returns an error Status.
Fix the issue by adding error handling for TpmMeasureAndLogDataWithFlags().

Signed-off-by: Du Lin <[email protected]>
Cc: Ashraf Ali S <[email protected]>
Cc: Chasel Chiu <[email protected]>
Cc: Chen Gang C <[email protected]>
Cc: Duggapu Chinni B <[email protected]>
Cc: Nate DeSimone <[email protected]>
Cc: Star Zeng <[email protected]>
Cc: Susovan Mohapatra <[email protected]>
Cc: Ted Kuo <[email protected]>
---
 .../Library/BaseFspMeasurementLib/FspMeasurementLib.c         | 4 ++++
 1 file changed, 4 insertions(+)

diff --git 
a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c 
b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c
index 2c017a4250..228277649b 100644
--- a/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c
+++ b/IntelFsp2WrapperPkg/Library/BaseFspMeasurementLib/FspMeasurementLib.c
@@ -197,6 +197,10 @@ MeasureFspFirmwareBlobWithCfg (
              (UINTN)sizeof (DigestList),
              EDKII_TCG_PRE_HASH_LOG_ONLY
              );
+  if (EFI_ERROR (Status)) {
+    DEBUG ((DEBUG_ERROR, "TpmMeasureAndLogDataWithFlags failed - %r\n", 
Status));
+    return Status;
+  }
 
   Status = TpmMeasureAndLogData (
              1,
-- 
2.26.2.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#116685): https://edk2.groups.io/g/devel/message/116685
Mute This Topic: https://groups.io/mt/104886875/21656
Group Owner: [email protected]
Unsubscribe: https://edk2.groups.io/g/devel/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to