ACPICA: Fixed a couple memory leaks associated with "implicit return"
authorLin Ming <ming.m.lin@intel.com>
Sat, 27 Sep 2008 03:50:24 +0000 (11:50 +0800)
committerLen Brown <len.brown@intel.com>
Thu, 23 Oct 2008 03:14:48 +0000 (23:14 -0400)
Fixed a couple memory leaks associated with "implicit return" objects
when the AML Interpreter slack mode is enabled.

http://www.acpica.org/bugzilla/show_bug.cgi?id=349

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

index 4613b9ca57929f5c4ba867c6f8aa496a887d3dbe..279a5a60a0dd492a2b27f144b12b353b9de78a2a 100644 (file)
@@ -103,6 +103,9 @@ acpi_ds_method_error(acpi_status status, struct acpi_walk_state *walk_state)
                                                    NULL);
                acpi_ex_enter_interpreter();
        }
+
+       acpi_ds_clear_implicit_return(walk_state);
+
 #ifdef ACPI_DISASSEMBLER
        if (ACPI_FAILURE(status)) {
 
index 52caaf6582e7c0a0e5a94faf1600206b81fb696c..68e932f215ea5ef73c407a241a4d11d3367897fa 100644 (file)
@@ -635,10 +635,12 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
                                            ACPI_WALK_METHOD_RESTART;
                                }
                        } else {
-                               /* On error, delete any return object */
+                               /* On error, delete any return object or implicit return */
 
                                acpi_ut_remove_reference(previous_walk_state->
                                                         return_desc);
+                               acpi_ds_clear_implicit_return
+                                   (previous_walk_state);
                        }
                }