summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2018-07-30 13:42:41 +0800
committerStar Zeng <star.zeng@intel.com>2018-08-01 10:05:12 +0800
commitfc0494a6540e9b3cca55f39c7e0d850e2bfd91bb (patch)
tree2bc567650795e093c8cdfb362d009737855c0751
parent7343bc8062c893ed6d40b25a9329d51340e0d703 (diff)
downloadedk2-fc0494a6540e9b3cca55f39c7e0d850e2bfd91bb.tar.gz
edk2-fc0494a6540e9b3cca55f39c7e0d850e2bfd91bb.tar.bz2
edk2-fc0494a6540e9b3cca55f39c7e0d850e2bfd91bb.zip
SignedCapsulePkg SystemFirmwareReportDxe: Try LocateProtocol
Try LocateProtocol after HandleProtocol fails to be compatible with old SystemFirmwareUpdateDxe. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
-rw-r--r--SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.c29
1 files changed, 18 insertions, 11 deletions
diff --git a/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.c b/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.c
index fb7b63be9d..8802404c9a 100644
--- a/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.c
+++ b/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.c
@@ -202,17 +202,24 @@ FmpSetImage (
(VOID **)&SystemFmp
);
if (EFI_ERROR(Status)) {
- DEBUG((DEBUG_INFO, "(Agent)SetImage - SystemFmpProtocol - %r\n", Status));
- SystemFmpPrivate->LastAttempt.LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT;
- VarStatus = gRT->SetVariable(
- SYSTEM_FMP_LAST_ATTEMPT_VARIABLE_NAME,
- &gSystemFmpLastAttemptVariableGuid,
- EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
- sizeof(SystemFmpPrivate->LastAttempt),
- &SystemFmpPrivate->LastAttempt
- );
- DEBUG((DEBUG_INFO, "(Agent)SetLastAttemp - %r\n", VarStatus));
- return Status;
+ Status = gBS->LocateProtocol (
+ &gSystemFmpProtocolGuid,
+ NULL,
+ (VOID **)&SystemFmp
+ );
+ if (EFI_ERROR(Status)) {
+ DEBUG((DEBUG_INFO, "(Agent)SetImage - SystemFmpProtocol - %r\n", Status));
+ SystemFmpPrivate->LastAttempt.LastAttemptStatus = LAST_ATTEMPT_STATUS_ERROR_INVALID_FORMAT;
+ VarStatus = gRT->SetVariable(
+ SYSTEM_FMP_LAST_ATTEMPT_VARIABLE_NAME,
+ &gSystemFmpLastAttemptVariableGuid,
+ EFI_VARIABLE_NON_VOLATILE | EFI_VARIABLE_BOOTSERVICE_ACCESS,
+ sizeof(SystemFmpPrivate->LastAttempt),
+ &SystemFmpPrivate->LastAttempt
+ );
+ DEBUG((DEBUG_INFO, "(Agent)SetLastAttemp - %r\n", VarStatus));
+ return Status;
+ }
}
return SystemFmp->SetImage(SystemFmp, ImageIndex, Image, ImageSize, VendorCode, Progress, AbortReason);