]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
ACPICA: Fix for Alias references within Package objects
authorBob Moore <robert.moore@intel.com>
Tue, 6 Jul 2010 02:37:13 +0000 (10:37 +0800)
committerLen Brown <len.brown@intel.com>
Wed, 7 Jul 2010 02:34:27 +0000 (22:34 -0400)
This fixes a problem where a reference to an Alias within the
definition of a Package was not always resolved properly. Aliases
to objects like Processors, ThermalZones, etc. were resolved to the
actual object instead of a reference to the object as it should be.
Package objects are only allowed to contain integer, string,
buffer, package, and reference objects.

https://bugzilla.redhat.com/show_bug.cgi?id=608648

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/acpica/dsobject.c

index 3607adcaf08596afc5dc8ac31f872bf81830ad01..8e85f54a8e0ef396ed6d045f84a6f86587e34af0 100644 (file)
@@ -81,6 +81,7 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
 {
        union acpi_operand_object *obj_desc;
        acpi_status status;
+       acpi_object_type type;
 
        ACPI_FUNCTION_TRACE(ds_build_internal_object);
 
@@ -172,7 +173,20 @@ acpi_ds_build_internal_object(struct acpi_walk_state *walk_state,
                                return_ACPI_STATUS(status);
                        }
 
-                       switch (op->common.node->type) {
+                       /*
+                        * Special handling for Alias objects. We need to setup the type
+                        * and the Op->Common.Node to point to the Alias target. Note,
+                        * Alias has at most one level of indirection internally.
+                        */
+                       type = op->common.node->type;
+                       if (type == ACPI_TYPE_LOCAL_ALIAS) {
+                               type = obj_desc->common.type;
+                               op->common.node =
+                                   ACPI_CAST_PTR(struct acpi_namespace_node,
+                                                 op->common.node->object);
+                       }
+
+                       switch (type) {
                                /*
                                 * For these types, we need the actual node, not the subobject.
                                 * However, the subobject did not get an extra reference count above.