]> err.no Git - linux-2.6/commitdiff
ACPICA: Add error checks to prevent faults
authorBob Moore <robert.moore@intel.com>
Thu, 10 Apr 2008 15:06:39 +0000 (19:06 +0400)
committerLen Brown <len.brown@intel.com>
Tue, 22 Apr 2008 18:29:26 +0000 (14:29 -0400)
Added additional error checking to prevent run-time faults.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/executer/exstore.c
drivers/acpi/namespace/nsnames.c

index 912889ed45ed29295c9ca2564593b4078841cdec..d860f9c6172cc6a0b735911d16be2df5c679e977 100644 (file)
@@ -209,8 +209,16 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc,
                                                        object, level + 4, 0);
                        }
                } else if (source_desc->reference.node) {
-                       acpi_ex_do_debug_object((source_desc->reference.node)->
-                                               object, level + 4, 0);
+                       if (ACPI_GET_DESCRIPTOR_TYPE
+                           (source_desc->reference.node) !=
+                           ACPI_DESC_TYPE_NAMED) {
+                               ACPI_DEBUG_PRINT_RAW((ACPI_DB_DEBUG_OBJECT,
+                                                     " %p - Not a valid namespace node\n"));
+                       } else {
+                               acpi_ex_do_debug_object((source_desc->reference.
+                                                        node)->object,
+                                                       level + 4, 0);
+                       }
                }
                break;
 
index cbd94af08cc5e00aa07c8c1075591c0124194700..e14a1412656b7a42396f70f88d4800a083372c2e 100644 (file)
@@ -180,6 +180,12 @@ acpi_size acpi_ns_get_pathname_length(struct acpi_namespace_node *node)
        next_node = node;
 
        while (next_node && (next_node != acpi_gbl_root_node)) {
+               if (ACPI_GET_DESCRIPTOR_TYPE(next_node) != ACPI_DESC_TYPE_NAMED) {
+                       ACPI_ERROR((AE_INFO,
+                                   "Invalid NS Node (%X) while traversing path",
+                                   next_node));
+                       return 0;
+               }
                size += ACPI_PATH_SEGMENT_LENGTH;
                next_node = acpi_ns_get_parent_node(next_node);
        }