Bug 506 - Processor or Thermal Zone as Device parameter of AcpiInstallAddressSpaceHandler causes Memory leak
: Processor or Thermal Zone as Device parameter of AcpiInstallAddressSpaceHandl...
Status: RESOLVED FIXED
: ACPICA
Core/Interpreter
: unspecified
: All Linux
: P1 normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2006-12-26 20:59 by
Modified: 2008-06-18 13:20 (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2006-12-26 20:59:44
Memory leak is detected when Processor or Thermal Zone Object is used
as the Device handle parameter of AcpiInstallAddressSpaceHandler().

This parameter is specified to be of ACPI_TYPE_DEVICE, ACPI_TYPE_PROCESSOR,
or ACPI_TYPE_THERMAL type. When it is of ACPI_TYPE_DEVICE type Memory leak
doesn't occur.

In AcpiUtDeleteInternalObj() there is handler list processing only
for the Object of ACPI_TYPE_DEVICE type:

utilities/utdelete.c
AcpiUtDeleteInternalObj (
...
    case ACPI_TYPE_DEVICE:
...
        /* Walk the handler list for this device */

        HandlerDesc = Object->Device.Handler;
        while (HandlerDesc)
        {
            NextDesc = HandlerDesc->AddressSpace.Next;
            AcpiUtRemoveReference (HandlerDesc);
            HandlerDesc = NextDesc;
        }
        break;

In AcpiInstallAddressSpaceHandler() ACPI_TYPE_DEVICE, ACPI_TYPE_PROCESSOR,
and ACPI_TYPE_THERMAL Objects are processed equally. Therefore their handler
lists should be processed equally in AcpiUtDeleteInternalObj().

INTERNAL API TS BUG NUMBER:

             46
------- Comment #1 From 2006-12-26 21:00:55 -------
The following update extends handler list cleanup in AcpiUtDeleteInternalObj()
to cover Processor and Thermal Zone Objects:

--- source.orig/components/utilities/utdelete.c      2006-07-24 
11:12:06.000000000 +0400
+++ source/components/utilities/utdelete.c     2006-12-22 14:49:50.102827900 
+0300
@@ -229,9 +229,13 @@ AcpiUtDeleteInternalObj (
             (void) AcpiEvDeleteGpeBlock (Object->Device.GpeBlock);
         }
 
+        /* Fall through */
+
+    case ACPI_TYPE_PROCESSOR:
+    case ACPI_TYPE_THERMAL:
         /* Walk the handler list for this device */
 
-        HandlerDesc = Object->Device.Handler;
+        HandlerDesc = Object->CommonNotify.Handler;
         while (HandlerDesc)
         {
             NextDesc = HandlerDesc->AddressSpace.Next;

------- Comment #2 From 2008-06-18 13:20:08 -------
Fixed 18 June 2008. Will appear in next ACPICA release.