diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-10-06 22:27:24 +0100 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-10-06 22:31:10 +0100 |
commit | aed68ed6bec5432d531e68e825400907c4968cc3 (patch) | |
tree | 5bafa718c8666edac092101c09b9a62ae0eb9291 /ArmPkg | |
parent | bbf79aa264b638fd4717cfb1b8fd5a7997861fe7 (diff) | |
download | edk2-aed68ed6bec5432d531e68e825400907c4968cc3.tar.gz edk2-aed68ed6bec5432d531e68e825400907c4968cc3.tar.bz2 edk2-aed68ed6bec5432d531e68e825400907c4968cc3.zip |
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.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c b/ArmPkg/Library/PlatformBootManagerLib/PlatformBm.c index e950695162..95e739c66c 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
//
|