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>
MmGuidedEventNotify, mGuidedEventGuid[Index],\r
mGuidedEventGuid[Index], &mGuidedEvent[Index]);\r
ASSERT_EFI_ERROR (Status);\r
+ if (EFI_ERROR (Status)) {\r
+ while (Index-- > 0) {\r
+ gBS->CloseEvent (mGuidedEvent[Index]);\r
+ }\r
+ goto UninstallProtocol;\r
+ }\r
}\r
+ return EFI_SUCCESS;\r
\r
+UninstallProtocol:\r
gBS->UninstallProtocolInterface (\r
mMmCommunicateHandle,\r
&gEfiMmCommunicationProtocolGuid,\r