aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2008-07-04 10:41:41 +0800
committerAndi Kleen <ak@linux.intel.com>2008-08-15 02:11:59 +0200
commit2843ae7734075f5d7072cf1230758bf8cf840af7 (patch)
treec24445a6bcaab163b60f0557c8acdb3f1b3777b0
parentb635acec48bcaa9183fcbf4e3955616b0d4119b5 (diff)
ACPICA: Fix memory leak when deleting thermal/processor objects
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>
-rw-r--r--drivers/acpi/utilities/utdelete.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index c5c791a575c..42609d3a8aa 100644
--- a/drivers/acpi/utilities/utdelete.c
+++ b/drivers/acpi/utilities/utdelete.c
@@ -135,6 +135,10 @@ 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) {
@@ -142,9 +146,14 @@ static void acpi_ut_delete_internal_obj(union acpi_operand_object *object)
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);