ACPICA: fix for object premature deletion
authorFiodor Suietov <fiodor.f.suietov@intel.com>
Fri, 2 Feb 2007 16:48:18 +0000 (19:48 +0300)
committerLen Brown <len.brown@intel.com>
Sat, 3 Feb 2007 02:14:21 +0000 (21:14 -0500)
Fix for object premature deletion after CopyObject
on Operation Region (BZ 350)

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/utilities/utcopy.c

index 5e1a80d..5c38276 100644 (file)
@@ -719,6 +719,15 @@ acpi_ut_copy_simple_object(union acpi_operand_object *source_desc,
                acpi_ut_add_reference(source_desc->reference.object);
                break;
 
+       case ACPI_TYPE_REGION:
+               /*
+                * We copied the Region Handler, so we now must add a reference
+                */
+               if (dest_desc->region.handler) {
+                       acpi_ut_add_reference(dest_desc->region.handler);
+               }
+               break;
+
        default:
                /* Nothing to do for other simple objects */
                break;