ArmPkg/PlatformBootManagerLib: fix bug in ESRT invocation

The ESRT hook call that I just added invokes the protocol before
retrieving a pointer to it, which interestingly enough did not
result in any crashes, nor did it get picked up by GCC. Clang did
notice, though, so let's fix it right away.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
This commit is contained in:
Ard Biesheuvel 2017-10-06 22:27:24 +01:00
parent bbf79aa264
commit aed68ed6be
1 changed files with 3 additions and 7 deletions

View File

@ -458,17 +458,13 @@ PlatformBootManagerBeforeConsole (
Status = ProcessCapsules ();
DEBUG ((DEBUG_INFO, "ProcessCapsules returned %r\n", Status));
} else {
if (EsrtManagement != NULL) {
Status = gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL,
(VOID **)&EsrtManagement);
if (!EFI_ERROR (Status)) {
EsrtManagement->SyncEsrtFmp ();
}
}
Status = gBS->LocateProtocol (&gEsrtManagementProtocolGuid, NULL,
(VOID **)&EsrtManagement);
if (EFI_ERROR (Status)) {
EsrtManagement = NULL;
}
//
// Signal EndOfDxe PI Event
//