Skip to content

Commit

Permalink
Update resource descriptor handling
Browse files Browse the repository at this point in the history
This change restores the change introduced by commit 23b5bbe and
adds a comment concerning resource descriptor buffers that extend
beyond the END_TAG descriptor.
  • Loading branch information
acpibob committed Apr 13, 2017
1 parent 8c3ff86 commit c8eac10
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions source/components/utilities/utresrc.c
Expand Up @@ -604,9 +604,11 @@ AcpiUtWalkAmlResources (
ACPI_FUNCTION_TRACE (UtWalkAmlResources);


/* The absolute minimum resource template is one EndTag descriptor */

if (AmlLength < sizeof (AML_RESOURCE_END_TAG))
/*
* The absolute minimum resource template is one EndTag descriptor.
* However, we will treat a lone EndTag as just a simple buffer.
*/
if (AmlLength <= sizeof (AML_RESOURCE_END_TAG))
{
return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
}
Expand Down Expand Up @@ -677,8 +679,10 @@ AcpiUtWalkAmlResources (
*Context = Aml;
}

/* Normal exit */

/*
* Normal exit. Note: We allow the buffer to be larger than
* the resource template, as long as the END_TAG exists.
*/
return_ACPI_STATUS (AE_OK);
}

Expand Down

0 comments on commit c8eac10

Please sign in to comment.