Skip to content

Commit

Permalink
ACPICA: Fix memory leak when deleting thermal/processor objects
Browse files Browse the repository at this point in the history
Fixes a possible memory leak when thermal and processor objects
are deleted. Any associated notify handlers (and objects) were
not being deleted. Fiodor Suietov. BZ 506

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

Signed-off-by: Fiodor Suietov <fiodor.f.suietov@intel.com>
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
  • Loading branch information
Bob Moore authored and Andi Kleen committed Aug 15, 2008
1 parent b635ace commit 2843ae7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions drivers/acpi/utilities/utdelete.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,16 +135,25 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
obj_pointer = object->package.elements;
break;

/*
* These objects have a possible list of notify handlers.
* Device object also may have a GPE block.
*/
case ACPI_TYPE_DEVICE:

if (object->device.gpe_block) {
(void)acpi_ev_delete_gpe_block(object->device.
gpe_block);
}

/* Walk the handler list for this device */
/*lint -fallthrough */

case ACPI_TYPE_PROCESSOR:
case ACPI_TYPE_THERMAL:

/* Walk the notify handler list for this object */

handler_desc = object->device.handler;
handler_desc = object->common_notify.handler;
while (handler_desc) {
next_desc = handler_desc->address_space.next;
acpi_ut_remove_reference(handler_desc);
Expand Down

0 comments on commit 2843ae7

Please sign in to comment.