summaryrefslogtreecommitdiff
path: root/source/components/tables/tbutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/tables/tbutils.c')
-rw-r--r--source/components/tables/tbutils.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/source/components/tables/tbutils.c b/source/components/tables/tbutils.c
index c7e0ee75372e6..db3fe56de46f3 100644
--- a/source/components/tables/tbutils.c
+++ b/source/components/tables/tbutils.c
@@ -559,14 +559,19 @@ AcpiTbGetTable (
}
}
- TableDesc->ValidationCount++;
- if (TableDesc->ValidationCount == 0)
+ if (TableDesc->ValidationCount < ACPI_MAX_TABLE_VALIDATIONS)
{
- ACPI_ERROR ((AE_INFO,
- "Table %p, Validation count is zero after increment\n",
- TableDesc));
- TableDesc->ValidationCount--;
- return_ACPI_STATUS (AE_LIMIT);
+ TableDesc->ValidationCount++;
+
+ /*
+ * Detect ValidationCount overflows to ensure that the warning
+ * message will only be printed once.
+ */
+ if (TableDesc->ValidationCount >= ACPI_MAX_TABLE_VALIDATIONS)
+ {
+ ACPI_WARNING((AE_INFO,
+ "Table %p, Validation count overflows\n", TableDesc));
+ }
}
*OutTable = TableDesc->Pointer;
@@ -597,14 +602,21 @@ AcpiTbPutTable (
ACPI_FUNCTION_TRACE (AcpiTbPutTable);
- if (TableDesc->ValidationCount == 0)
+ if (TableDesc->ValidationCount < ACPI_MAX_TABLE_VALIDATIONS)
{
- ACPI_WARNING ((AE_INFO,
- "Table %p, Validation count is zero before decrement\n",
- TableDesc));
- return_VOID;
+ TableDesc->ValidationCount--;
+
+ /*
+ * Detect ValidationCount underflows to ensure that the warning
+ * message will only be printed once.
+ */
+ if (TableDesc->ValidationCount >= ACPI_MAX_TABLE_VALIDATIONS)
+ {
+ ACPI_WARNING ((AE_INFO,
+ "Table %p, Validation count underflows\n", TableDesc));
+ return_VOID;
+ }
}
- TableDesc->ValidationCount--;
if (TableDesc->ValidationCount == 0)
{