Skip to content

Commit

Permalink
Update for automatic repair code for objects returned by evaluate_object
Browse files Browse the repository at this point in the history
This change fixes two instances where the repair code made an incorrect
assumption about how reference counts are assigned to package objects.
Resolves issues where a warning was issued about a "large reference
count" -- which usually indicates an attempt to delete an object
that has previously been poisoned and released into the object cache.
  • Loading branch information
acpibob committed Feb 22, 2017
1 parent a4f29a3 commit 6b58810
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 19 deletions.
16 changes: 2 additions & 14 deletions source/components/namespace/nsrepair.c
Expand Up @@ -374,24 +374,12 @@ AcpiNsSimpleRepair (

if (PackageIndex != ACPI_NOT_PACKAGE_ELEMENT)
{
/*
* The original object is a package element. We need to
* decrement the reference count of the original object,
* for removing it from the package.
*
* However, if the original object was just wrapped with a
* package object as part of the repair, we don't need to
* change the reference count.
*/
/* Update reference count of new object */

if (!(Info->ReturnFlags & ACPI_OBJECT_WRAPPED))
{
NewObject->Common.ReferenceCount =
ReturnObject->Common.ReferenceCount;

if (ReturnObject->Common.ReferenceCount > 1)
{
ReturnObject->Common.ReferenceCount--;
}
}

ACPI_DEBUG_PRINT ((ACPI_DB_REPAIR,
Expand Down
6 changes: 1 addition & 5 deletions source/components/namespace/nsrepair2.c
Expand Up @@ -520,16 +520,12 @@ AcpiNsRepair_CID (
return (Status);
}

/* Take care with reference counts */

if (OriginalElement != *ElementPtr)
{
/* Element was replaced */
/* Update reference count of new object */

(*ElementPtr)->Common.ReferenceCount =
OriginalRefCount;

AcpiUtRemoveReference (OriginalElement);
}

ElementPtr++;
Expand Down

0 comments on commit 6b58810

Please sign in to comment.