From: Lin Ming Date: Fri, 11 Dec 2009 06:36:47 +0000 (+0800) Subject: ACPICA: Fix possible memory leak for module-level code execution X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=583061c59ffea1ea14f6dca735ab0f99238a7a92;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git ACPICA: Fix possible memory leak for module-level code execution An object can be leaked for each block of executed module-level code if the interpreter slack mode is enabled. The change deletes any implicitly returned object in this case. Signed-off-by: Lin Ming Signed-off-by: Bob Moore Signed-off-by: Len Brown --- diff --git a/drivers/acpi/acpica/nseval.c b/drivers/acpi/acpica/nseval.c index f771e978c403..65e0d1a260ea 100644 --- a/drivers/acpi/acpica/nseval.c +++ b/drivers/acpi/acpica/nseval.c @@ -415,6 +415,12 @@ acpi_ns_exec_module_code(union acpi_operand_object *method_obj, ACPI_DEBUG_PRINT((ACPI_DB_INIT, "Executed module-level code at %p\n", method_obj->method.aml_start)); + /* Delete a possible implicit return value (in slack mode) */ + + if (info->return_object) { + acpi_ut_remove_reference(info->return_object); + } + /* Detach the temporary method object */ acpi_ns_detach_object(parent_node);