Add error checks to prevent faults.

Added additional error checking to prevent run-time faults.
This commit is contained in:
rmoore1 2007-10-04 21:06:51 +00:00
parent dcba62db2e
commit 76a3fdcfd6
2 changed files with 18 additions and 4 deletions

View File

@ -2,7 +2,7 @@
/******************************************************************************
*
* Module Name: exstore - AML Interpreter object store support
* $Revision: 1.204 $
* $Revision: 1.205 $
*
*****************************************************************************/
@ -296,8 +296,17 @@ AcpiExDoDebugObject (
}
else if (SourceDesc->Reference.Node)
{
AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object,
Level+4, 0);
if (ACPI_GET_DESCRIPTOR_TYPE (SourceDesc->Reference.Node) !=
ACPI_DESC_TYPE_NAMED)
{
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DEBUG_OBJECT,
" %p - Not a valid namespace node\n"));
}
else
{
AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object,
Level+4, 0);
}
}
break;

View File

@ -1,7 +1,7 @@
/*******************************************************************************
*
* Module Name: nsnames - Name manipulation and search
* $Revision: 1.98 $
* $Revision: 1.99 $
*
******************************************************************************/
@ -277,6 +277,11 @@ AcpiNsGetPathnameLength (
while (NextNode && (NextNode != AcpiGbl_RootNode))
{
if (ACPI_GET_DESCRIPTOR_TYPE (NextNode) != ACPI_DESC_TYPE_NAMED)
{
ACPI_ERROR ((AE_INFO, "Invalid NS Node (%X) while traversing path", NextNode));
return 0;
}
Size += ACPI_PATH_SEGMENT_LENGTH;
NextNode = AcpiNsGetParentNode (NextNode);
}