|
|
305057 |
commit 50bde98a8268e940c0d072de0546685c5c2f893b
|
|
|
305057 |
Author: Robert Moore <Robert.Moore@intel.com>
|
|
|
305057 |
AuthorDate: Fri Jun 19 09:44:39 2015 -0700
|
|
|
305057 |
Commit: Robert Moore <Robert.Moore@intel.com>
|
|
|
305057 |
CommitDate: Fri Jun 19 09:44:39 2015 -0700
|
|
|
305057 |
|
|
|
305057 |
iASL/Disassembler: Add status checks in the dmtbdump module.
|
|
|
305057 |
|
|
|
305057 |
Error checking after calls to AcpiDmDumpTable was inconsistent.
|
|
|
305057 |
ACPICA BZ 1169.
|
|
|
305057 |
|
|
|
305057 |
diff --git a/source/common/dmtbdump.c b/source/common/dmtbdump.c
|
|
|
305057 |
index 4711b68..bb9cf55 100644
|
|
|
305057 |
--- a/source/common/dmtbdump.c
|
|
|
305057 |
+++ b/source/common/dmtbdump.c
|
|
|
305057 |
@@ -208,11 +208,16 @@ AcpiDmDumpRsdp (
|
|
|
305057 |
ACPI_TABLE_RSDP *Rsdp = ACPI_CAST_PTR (ACPI_TABLE_RSDP, Table);
|
|
|
305057 |
UINT32 Length = sizeof (ACPI_RSDP_COMMON);
|
|
|
305057 |
UINT8 Checksum;
|
|
|
305057 |
+ ACPI_STATUS Status;
|
|
|
305057 |
|
|
|
305057 |
|
|
|
305057 |
/* Dump the common ACPI 1.0 portion */
|
|
|
305057 |
|
|
|
305057 |
- AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1);
|
|
|
305057 |
+ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp1);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return (Length);
|
|
|
305057 |
+ }
|
|
|
305057 |
|
|
|
305057 |
/* Validate the first checksum */
|
|
|
305057 |
|
|
|
305057 |
@@ -229,7 +234,11 @@ AcpiDmDumpRsdp (
|
|
|
305057 |
if (Rsdp->Revision > 0)
|
|
|
305057 |
{
|
|
|
305057 |
Length = Rsdp->Length;
|
|
|
305057 |
- AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2);
|
|
|
305057 |
+ Status = AcpiDmDumpTable (Length, 0, Table, 0, AcpiDmTableInfoRsdp2);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return (Length);
|
|
|
305057 |
+ }
|
|
|
305057 |
|
|
|
305057 |
/* Validate the extended checksum over entire RSDP */
|
|
|
305057 |
|
|
|
305057 |
@@ -347,37 +356,59 @@ void
|
|
|
305057 |
AcpiDmDumpFadt (
|
|
|
305057 |
ACPI_TABLE_HEADER *Table)
|
|
|
305057 |
{
|
|
|
305057 |
+ ACPI_STATUS Status;
|
|
|
305057 |
+
|
|
|
305057 |
|
|
|
305057 |
/* Always dump the minimum FADT revision 1 fields (ACPI 1.0) */
|
|
|
305057 |
|
|
|
305057 |
- AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1);
|
|
|
305057 |
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt1);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return;
|
|
|
305057 |
+ }
|
|
|
305057 |
|
|
|
305057 |
/* Check for FADT revision 2 fields (ACPI 1.0B MS extensions) */
|
|
|
305057 |
|
|
|
305057 |
if ((Table->Length > ACPI_FADT_V1_SIZE) &&
|
|
|
305057 |
(Table->Length <= ACPI_FADT_V2_SIZE))
|
|
|
305057 |
{
|
|
|
305057 |
- AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
|
|
|
305057 |
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt2);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return;
|
|
|
305057 |
+ }
|
|
|
305057 |
}
|
|
|
305057 |
|
|
|
305057 |
/* Check for FADT revision 3/4 fields and up (ACPI 2.0+ extended data) */
|
|
|
305057 |
|
|
|
305057 |
else if (Table->Length > ACPI_FADT_V2_SIZE)
|
|
|
305057 |
{
|
|
|
305057 |
- AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3);
|
|
|
305057 |
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt3);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return;
|
|
|
305057 |
+ }
|
|
|
305057 |
|
|
|
305057 |
/* Check for FADT revision 5 fields and up (ACPI 5.0+) */
|
|
|
305057 |
|
|
|
305057 |
if (Table->Length > ACPI_FADT_V3_SIZE)
|
|
|
305057 |
{
|
|
|
305057 |
- AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5);
|
|
|
305057 |
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt5);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return;
|
|
|
305057 |
+ }
|
|
|
305057 |
}
|
|
|
305057 |
|
|
|
305057 |
/* Check for FADT revision 6 fields and up (ACPI 6.0+) */
|
|
|
305057 |
|
|
|
305057 |
if (Table->Length > ACPI_FADT_V3_SIZE)
|
|
|
305057 |
{
|
|
|
305057 |
- AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6);
|
|
|
305057 |
+ Status = AcpiDmDumpTable (Table->Length, 0, Table, 0, AcpiDmTableInfoFadt6);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return;
|
|
|
305057 |
+ }
|
|
|
305057 |
}
|
|
|
305057 |
}
|
|
|
305057 |
|
|
|
305057 |
@@ -1136,7 +1167,7 @@ AcpiDmDumpDrtm (
|
|
|
305057 |
AcpiDmTableInfoDrtm1);
|
|
|
305057 |
if (ACPI_FAILURE (Status))
|
|
|
305057 |
{
|
|
|
305057 |
- return;
|
|
|
305057 |
+ return;
|
|
|
305057 |
}
|
|
|
305057 |
|
|
|
305057 |
Offset += ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST, Resources);
|
|
|
305057 |
@@ -1164,13 +1195,9 @@ AcpiDmDumpDrtm (
|
|
|
305057 |
|
|
|
305057 |
DrtmDps = ACPI_ADD_PTR (ACPI_DRTM_DPS_ID, Table, Offset);
|
|
|
305057 |
AcpiOsPrintf ("\n");
|
|
|
305057 |
- Status = AcpiDmDumpTable (Table->Length, Offset,
|
|
|
305057 |
+ (void) AcpiDmDumpTable (Table->Length, Offset,
|
|
|
305057 |
DrtmDps, sizeof (ACPI_DRTM_DPS_ID),
|
|
|
305057 |
AcpiDmTableInfoDrtm2);
|
|
|
305057 |
- if (ACPI_FAILURE (Status))
|
|
|
305057 |
- {
|
|
|
305057 |
- return;
|
|
|
305057 |
- }
|
|
|
305057 |
}
|
|
|
305057 |
|
|
|
305057 |
|
|
|
305057 |
@@ -1794,6 +1821,10 @@ AcpiDmDumpIort (
|
|
|
305057 |
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
|
|
305057 |
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
|
|
305057 |
Length, AcpiDmTableInfoIort3a);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return;
|
|
|
305057 |
+ }
|
|
|
305057 |
|
|
|
305057 |
NodeOffset = IortSmmu->ContextInterruptOffset;
|
|
|
305057 |
for (i = 0; i < IortSmmu->ContextInterruptCount; i++)
|
|
|
305057 |
@@ -1801,6 +1832,10 @@ AcpiDmDumpIort (
|
|
|
305057 |
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
|
|
305057 |
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
|
|
305057 |
8, AcpiDmTableInfoIort3b);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return;
|
|
|
305057 |
+ }
|
|
|
305057 |
NodeOffset += 8;
|
|
|
305057 |
}
|
|
|
305057 |
|
|
|
305057 |
@@ -1810,6 +1845,10 @@ AcpiDmDumpIort (
|
|
|
305057 |
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
|
|
305057 |
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
|
|
305057 |
8, AcpiDmTableInfoIort3c);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return;
|
|
|
305057 |
+ }
|
|
|
305057 |
NodeOffset += 8;
|
|
|
305057 |
}
|
|
|
305057 |
}
|
|
|
305057 |
@@ -1830,6 +1869,10 @@ AcpiDmDumpIort (
|
|
|
305057 |
Status = AcpiDmDumpTable (Table->Length, Offset + NodeOffset,
|
|
|
305057 |
ACPI_ADD_PTR (ACPI_IORT_NODE, IortNode, NodeOffset),
|
|
|
305057 |
Length, AcpiDmTableInfoIortMap);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return;
|
|
|
305057 |
+ }
|
|
|
305057 |
NodeOffset += Length;
|
|
|
305057 |
}
|
|
|
305057 |
|
|
|
305057 |
@@ -2004,6 +2047,10 @@ AcpiDmDumpIvrs (
|
|
|
305057 |
|
|
|
305057 |
Status = AcpiDmDumpTable (Table->Length, EntryOffset,
|
|
|
305057 |
DeviceEntry, EntryLength, InfoTable);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return;
|
|
|
305057 |
+ }
|
|
|
305057 |
|
|
|
305057 |
EntryOffset += EntryLength;
|
|
|
305057 |
DeviceEntry = ACPI_ADD_PTR (ACPI_IVRS_DE_HEADER, DeviceEntry,
|
|
|
305057 |
@@ -2687,6 +2734,11 @@ AcpiDmDumpNfit (
|
|
|
305057 |
Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
|
|
|
305057 |
&Interleave->LineOffset[i],
|
|
|
305057 |
sizeof (UINT32), AcpiDmTableInfoNfit2a);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return;
|
|
|
305057 |
+ }
|
|
|
305057 |
+
|
|
|
305057 |
FieldOffset += sizeof (UINT32);
|
|
|
305057 |
}
|
|
|
305057 |
break;
|
|
|
305057 |
@@ -2715,6 +2767,11 @@ AcpiDmDumpNfit (
|
|
|
305057 |
Status = AcpiDmDumpTable (Table->Length, Offset + FieldOffset,
|
|
|
305057 |
&Hint->HintAddress[i],
|
|
|
305057 |
sizeof (UINT64), AcpiDmTableInfoNfit6a);
|
|
|
305057 |
+ if (ACPI_FAILURE (Status))
|
|
|
305057 |
+ {
|
|
|
305057 |
+ return;
|
|
|
305057 |
+ }
|
|
|
305057 |
+
|
|
|
305057 |
FieldOffset += sizeof (UINT64);
|
|
|
305057 |
}
|
|
|
305057 |
break;
|
|
|
305057 |
@@ -3126,7 +3183,7 @@ void
|
|
|
305057 |
AcpiDmDumpSlic (
|
|
|
305057 |
ACPI_TABLE_HEADER *Table)
|
|
|
305057 |
{
|
|
|
305057 |
- AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
|
|
|
305057 |
+ (void) AcpiDmDumpTable (Table->Length, sizeof (ACPI_TABLE_HEADER), Table,
|
|
|
305057 |
Table->Length - sizeof (*Table), AcpiDmTableInfoSlic);
|
|
|
305057 |
}
|
|
|
305057 |
|
|
|
305057 |
@@ -3497,10 +3554,6 @@ AcpiDmDumpWpbt (
|
|
|
305057 |
|
|
|
305057 |
/* Dump the arguments buffer */
|
|
|
305057 |
|
|
|
305057 |
- AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
|
|
|
305057 |
+ (void) AcpiDmDumpTable (Table->Length, 0, Table, ArgumentsLength,
|
|
|
305057 |
AcpiDmTableInfoWpbt0);
|
|
|
305057 |
- if (ACPI_FAILURE (Status))
|
|
|
305057 |
- {
|
|
|
305057 |
- return;
|
|
|
305057 |
- }
|
|
|
305057 |
}
|