diff options
author | Edward Pickup <edward.pickup@arm.com> | 2022-08-04 10:20:50 +0100 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2022-08-06 06:56:50 +0000 |
commit | 3e599bbc105ff089b21b6024100d585a8c781328 (patch) | |
tree | 6a1647c241df939a0a3673aabfe51b7682ffdfaf /DynamicTablesPkg | |
parent | a8f59e2eb44199040d2e1f747a6d950a25ed0984 (diff) | |
download | edk2-3e599bbc105ff089b21b6024100d585a8c781328.tar.gz edk2-3e599bbc105ff089b21b6024100d585a8c781328.tar.bz2 edk2-3e599bbc105ff089b21b6024100d585a8c781328.zip |
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>
Diffstat (limited to 'DynamicTablesPkg')
-rw-r--r-- | DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c index 40d99162cc..f28973c1a8 100644 --- a/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c +++ b/DynamicTablesPkg/Library/Acpi/Arm/AcpiIortLibArm/IortGenerator.c @@ -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,
|