diff options
author | Bob Moore <robert.moore@intel.com> | 2015-10-19 05:24:58 +0300 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2015-10-22 03:01:12 +0300 |
commit | a5922a1f738b077c9f341f4bf3c02be436d39687 (patch) | |
tree | 9a1d4b4818242ef99dad9752a8f93201b03e2dfa /drivers/acpi/acpica/utdecode.c | |
parent | ca321d1ca6723ed0e04edd09de49c92b24e3648e (diff) | |
download | linux-a5922a1f738b077c9f341f4bf3c02be436d39687.tar.xz |
ACPICA: Improve typechecking, both compile-time and runtime
ACPICA commit 8d0f96e2a11a4ceabb2cae4b41e0ce1f4d3786b9
Adds much stricter typechecking in the iASL compiler, and
also adds some additional checking in the interpreter.
Link: https://github.com/acpica/acpica/commit/8d0f96e2
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lv Zheng <lv.zheng@intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/utdecode.c')
-rw-r--r-- | drivers/acpi/acpica/utdecode.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c index d452a7837c8c..ecaaaffc0788 100644 --- a/drivers/acpi/acpica/utdecode.c +++ b/drivers/acpi/acpica/utdecode.c @@ -232,12 +232,27 @@ char *acpi_ut_get_type_name(acpi_object_type type) char *acpi_ut_get_object_type_name(union acpi_operand_object *obj_desc) { + ACPI_FUNCTION_TRACE(ut_get_object_type_name); if (!obj_desc) { - return ("[NULL Object Descriptor]"); + ACPI_DEBUG_PRINT((ACPI_DB_EXEC, "Null Object Descriptor\n")); + return_PTR("[NULL Object Descriptor]"); } - return (acpi_ut_get_type_name(obj_desc->common.type)); + /* These descriptor types share a common area */ + + if ((ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_OPERAND) && + (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) != ACPI_DESC_TYPE_NAMED)) { + ACPI_DEBUG_PRINT((ACPI_DB_EXEC, + "Invalid object descriptor type: 0x%2.2X [%s] (%p)\n", + ACPI_GET_DESCRIPTOR_TYPE(obj_desc), + acpi_ut_get_descriptor_name(obj_desc), + obj_desc)); + + return_PTR("Invalid object"); + } + + return_PTR(acpi_ut_get_type_name(obj_desc->common.type)); } /******************************************************************************* |