]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/utilities/utdelete.c
Merge branch 'bugzilla-10503' into test
[linux-2.6-omap-h63xx.git] / drivers / acpi / utilities / utdelete.c
index 42609d3a8aa9db23f3852743f767ee1641b631af..d197c6b29e170e2381e2fcd0765c4368e090121a 100644 (file)
@@ -45,7 +45,6 @@
 #include <acpi/acinterp.h>
 #include <acpi/acnamesp.h>
 #include <acpi/acevents.h>
-#include <acpi/amlcode.h>
 
 #define _COMPONENT          ACPI_UTILITIES
 ACPI_MODULE_NAME("utdelete")
@@ -548,8 +547,8 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
                         * reference must track changes to the ref count of the index or
                         * target object.
                         */
-                       if ((object->reference.opcode == AML_INDEX_OP) ||
-                           (object->reference.opcode == AML_INT_NAMEPATH_OP)) {
+                       if ((object->reference.class == ACPI_REFCLASS_INDEX) ||
+                           (object->reference.class == ACPI_REFCLASS_NAME)) {
                                next_object = object->reference.object;
                        }
                        break;
@@ -586,6 +585,13 @@ acpi_ut_update_object_reference(union acpi_operand_object *object, u16 action)
        ACPI_EXCEPTION((AE_INFO, status,
                        "Could not update object reference count"));
 
+       /* Free any stacked Update State objects */
+
+       while (state_list) {
+               state = acpi_ut_pop_generic_state(&state_list);
+               acpi_ut_delete_generic_state(state);
+       }
+
        return_ACPI_STATUS(status);
 }