summaryrefslogtreecommitdiff
path: root/ArmPkg
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2017-10-06 22:27:24 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2017-10-06 22:31:10 +0100
commitaed68ed6bec5432d531e68e825400907c4968cc3 (patch)
tree5bafa718c8666edac092101c09b9a62ae0eb9291 /ArmPkg
parentbbf79aa264b638fd4717cfb1b8fd5a7997861fe7 (diff)
downloadedk2-aed68ed6bec5432d531e68e825400907c4968cc3.zip
edk2-aed68ed6bec5432d531e68e825400907c4968cc3.tar.gz
edk2-aed68ed6bec5432d531e68e825400907c4968cc3.tar.bz2
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>
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
index e950695..95e739c 100644
--- a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
+++ b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c
@@ -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
//