ACPICA: Fix memory leak when deleting thermal/processor objects

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Friday, August 15, 2008 - 10:00 am

Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2843ae...
Commit:     2843ae7734075f5d7072cf1230758bf8cf840af7
Parent:     b635acec48bcaa9183fcbf4e3955616b0d4119b5
Author:     Bob Moore <robert.moore@intel.com>
AuthorDate: Fri Jul 4 10:41:41 2008 +0800
Committer:  Andi Kleen <ak@linux.intel.com>
CommitDate: Fri Aug 15 02:11:59 2008 +0200

    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>
---
 drivers/acpi/utilities/utdelete.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/acpi/utilities/utdelete.c b/drivers/acpi/utilities/utdelete.c
index c5c791a..42609d3 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);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ACPICA: Fix memory leak when deleting thermal/processor ob ..., Linux Kernel Mailing ..., (Fri Aug 15, 10:00 am)