Skip to content

Commit

Permalink
ACPICA: Fix possible memory leak for module-level code execution
Browse files Browse the repository at this point in the history
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 <ming.m.lin@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Lin Ming authored and Len Brown committed Dec 15, 2009
1 parent b00eb79 commit 583061c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/acpi/acpica/nseval.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 583061c

Please sign in to comment.