DynamicTablesPkg: Fix using RmrNodeCount unitlitialised

Fix using RmrNodeCount uninitliased by initliasing it to zero. Also, add
an additional check for ACPI version. This fixes a crash running on
kvmtool.

Signed-off-by: Edward Pickup <edward.pickup@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
This commit is contained in:
Edward Pickup 2022-08-04 10:20:50 +01:00 committed by mergify[bot]
parent a8f59e2eb4
commit 3e599bbc10
1 changed files with 6 additions and 1 deletions

View File

@ -2107,6 +2107,8 @@ BuildIortTable (
ASSERT (AcpiTableInfo->TableGeneratorId == This->GeneratorID);
ASSERT (AcpiTableInfo->AcpiTableSignature == This->AcpiTableSignature);
RmrNodeCount = 0;
if ((AcpiTableInfo->AcpiTableRevision < This->MinAcpiTableRevision) ||
(AcpiTableInfo->AcpiTableRevision > This->AcpiTableRevision))
{
@ -2714,7 +2716,10 @@ BuildIortTable (
}
}
if (RmrNodeCount > 0) {
if ((AcpiTableInfo->AcpiTableRevision >=
EFI_ACPI_IO_REMAPPING_TABLE_REVISION_05) &&
(RmrNodeCount > 0))
{
Status = AddRmrNodes (
This,
CfgMgrProtocol,