summaryrefslogtreecommitdiffstats
path: root/ArmPkg
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2020-02-26 13:06:31 +0100
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-03-04 17:42:43 +0000
commit3be909099cf66f26a5ace282e4cbbdc6bf7cb32b (patch)
tree892cede5ee1566da2ae62f62932f9a58a966b077 /ArmPkg
parente63d54db952634c2a3a6a24b6c2a4c6ff66f22bd (diff)
downloadedk2-3be909099cf66f26a5ace282e4cbbdc6bf7cb32b.tar.gz
edk2-3be909099cf66f26a5ace282e4cbbdc6bf7cb32b.tar.bz2
edk2-3be909099cf66f26a5ace282e4cbbdc6bf7cb32b.zip
ArmPkg/MmCommunicationDxe: fix logic bug in DXE driver entrypoint
Commit 2fe25a74d6fee3c2 ("ArmPkg/MmCommunicationDxe: relay architected PI events to MM context") update the ARM specific standalone MM client driver to register for certain events in the entrypoint code, but did so in a way that makes the entrypoint always return with an error. Instead, return EFI_SUCCESS if registering for those events succeeds, and back out the registrations that did succeed if one fails, and return an error. Fixes: 2fe25a74d6fee3c2 ("ArmPkg/MmCommunicationDxe: relay architected PI events to MM context") Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
Diffstat (limited to 'ArmPkg')
-rw-r--r--ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
index 5f52afa0fe..a9e06be1ad 100644
--- a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
+++ b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c
@@ -390,8 +390,16 @@ MmCommunicationInitialize (
MmGuidedEventNotify, mGuidedEventGuid[Index],
mGuidedEventGuid[Index], &mGuidedEvent[Index]);
ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status)) {
+ while (Index-- > 0) {
+ gBS->CloseEvent (mGuidedEvent[Index]);
+ }
+ goto UninstallProtocol;
+ }
}
+ return EFI_SUCCESS;
+UninstallProtocol:
gBS->UninstallProtocolInterface (
mMmCommunicateHandle,
&gEfiMmCommunicationProtocolGuid,