]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ACPICA: Fix possible memory leak on error in parser
authorLin Ming <ming.m.lin@intel.com>
Wed, 12 Nov 2008 06:56:59 +0000 (14:56 +0800)
committerLen Brown <len.brown@intel.com>
Tue, 30 Dec 2008 03:38:36 +0000 (22:38 -0500)
Fixes a possible memory leak if an allocation failure happens in
the parse loop. Must terminate an executing control method.
Lin Ming, Bob Moore. ACPICA BZ 489.

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

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/parser/psparse.c

index 68e932f215ea5ef73c407a241a4d11d3367897fa..dfd3d90280187a19deac6d03ac914dd24c7bc914 100644 (file)
@@ -451,6 +451,14 @@ acpi_status acpi_ps_parse_aml(struct acpi_walk_state *walk_state)
 
        thread = acpi_ut_create_thread_state();
        if (!thread) {
+               if (walk_state->method_desc) {
+
+                       /* Executing a control method - additional cleanup */
+
+                       acpi_ds_terminate_control_method(
+                               walk_state->method_desc, walk_state);
+               }
+
                acpi_ds_delete_walk_state(walk_state);
                return_ACPI_STATUS(AE_NO_MEMORY);
        }