summaryrefslogtreecommitdiffstats
path: root/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c
diff options
context:
space:
mode:
Diffstat (limited to 'ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c')
-rw-r--r--ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c27
1 files changed, 21 insertions, 6 deletions
diff --git a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c
index a56c7b21d5..0400799b5c 100644
--- a/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c
+++ b/ArmPkg/Drivers/ArmScmiDxe/ScmiDxe.c
@@ -63,8 +63,8 @@ ArmScmiDxeEntryPoint (
UINT32 Index;
UINT32 NumProtocols;
UINT32 ProtocolIndex;
- UINT8 SupportedList[MAX_PROTOCOLS];
- UINT32 SupportedListSize = sizeof (SupportedList);
+ UINT8 *SupportedList;
+ UINT32 SupportedListSize;
// Every SCMI implementation must implement the base protocol.
ASSERT (Protocols[0].Id == SCMI_PROTOCOL_ID_BASE);
@@ -108,13 +108,26 @@ ArmScmiDxeEntryPoint (
ASSERT (NumProtocols != 0);
+ SupportedListSize = (NumProtocols * sizeof (*SupportedList));
+
+ Status = gBS->AllocatePool (
+ EfiBootServicesData,
+ SupportedListSize,
+ (VOID**)&SupportedList
+ );
+ if (EFI_ERROR (Status)) {
+ ASSERT (FALSE);
+ return Status;
+ }
+
// Get the list of protocols supported by SCP firmware on the platform.
Status = BaseProtocol->DiscoverListProtocols (
- BaseProtocol,
- &SupportedListSize,
- SupportedList
- );
+ BaseProtocol,
+ &SupportedListSize,
+ SupportedList
+ );
if (EFI_ERROR (Status)) {
+ gBS->FreePool (SupportedList);
ASSERT (FALSE);
return Status;
}
@@ -134,5 +147,7 @@ ArmScmiDxeEntryPoint (
}
}
+ gBS->FreePool (SupportedList);
+
return EFI_SUCCESS;
}