aboutsummaryrefslogtreecommitdiff
path: root/source/compiler/dttable2.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/compiler/dttable2.c')
-rw-r--r--source/compiler/dttable2.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/source/compiler/dttable2.c b/source/compiler/dttable2.c
index 04f48cc0ca99..bbaaafaa763b 100644
--- a/source/compiler/dttable2.c
+++ b/source/compiler/dttable2.c
@@ -1474,13 +1474,14 @@ DtCompileSdev (
Namesp->DeviceIdOffset + Namesp->DeviceIdLength;
Namesp->VendorDataLength =
(UINT16) Subtable->Length;
+
+ /* Final size of entire namespace structure */
+
+ SdevHeader->Length = (UINT16)(sizeof(ACPI_SDEV_NAMESPACE) +
+ Subtable->Length + Namesp->DeviceIdLength);
}
}
- /* Final size of entire namespace structure */
-
- SdevHeader->Length = (UINT16) (sizeof (ACPI_SDEV_NAMESPACE) +
- Subtable->Length + Namesp->DeviceIdLength);
break;
case ACPI_SDEV_TYPE_PCIE_ENDPOINT_DEVICE:
@@ -1620,7 +1621,9 @@ DtCompileSlit (
DT_SUBTABLE *ParentTable;
DT_FIELD **PFieldList = (DT_FIELD **) List;
DT_FIELD *FieldList;
+ DT_FIELD *EndOfFieldList = NULL;
UINT32 Localities;
+ UINT32 LocalityListLength;
UINT8 *LocalityBuffer;
@@ -1636,6 +1639,7 @@ DtCompileSlit (
Localities = *ACPI_CAST_PTR (UINT32, Subtable->Buffer);
LocalityBuffer = UtLocalCalloc (Localities);
+ LocalityListLength = 0;
/* Compile each locality buffer */
@@ -1645,11 +1649,22 @@ DtCompileSlit (
DtCompileBuffer (LocalityBuffer,
FieldList->Value, FieldList, Localities);
+ LocalityListLength++;
DtCreateSubtable (LocalityBuffer, Localities, &Subtable);
DtInsertSubtable (ParentTable, Subtable);
+ EndOfFieldList = FieldList;
FieldList = FieldList->Next;
}
+ if (LocalityListLength != Localities)
+ {
+ sprintf(AslGbl_MsgBuffer,
+ "Found %u entries, must match LocalityCount: %u",
+ LocalityListLength, Localities);
+ DtError (ASL_ERROR, ASL_MSG_ENTRY_LIST, EndOfFieldList, AslGbl_MsgBuffer);
+ return (AE_LIMIT);
+ }
+
ACPI_FREE (LocalityBuffer);
return (AE_OK);
}