diff options
author | Star Zeng <star.zeng@intel.com> | 2018-07-30 13:42:41 +0800 |
---|---|---|
committer | Star Zeng <star.zeng@intel.com> | 2018-08-01 10:05:12 +0800 |
commit | fc0494a6540e9b3cca55f39c7e0d850e2bfd91bb (patch) | |
tree | 2bc567650795e093c8cdfb362d009737855c0751 /SignedCapsulePkg | |
parent | 7343bc8062c893ed6d40b25a9329d51340e0d703 (diff) | |
download | edk2-fc0494a6540e9b3cca55f39c7e0d850e2bfd91bb.zip edk2-fc0494a6540e9b3cca55f39c7e0d850e2bfd91bb.tar.gz edk2-fc0494a6540e9b3cca55f39c7e0d850e2bfd91bb.tar.bz2 |
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>
Diffstat (limited to 'SignedCapsulePkg')
-rw-r--r-- | SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.c | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.c b/SignedCapsulePkg/Universal/SystemFirmwareUpdate/SystemFirmwareReportDxe.c index fb7b63b..8802404 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);
|