Skip to content

Commit

Permalink
ACPICA: Fixes for size of StartDependent resource descriptor
Browse files Browse the repository at this point in the history
Fixed a couple of size calculation issues with the variable-length
Start Dependent resource descriptor.

Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Bob Moore authored and Len Brown committed Apr 22, 2008
1 parent d884657 commit 66d3ca9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions drivers/acpi/resources/rscalc.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,11 +213,22 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
switch (resource->type) {
case ACPI_RESOURCE_TYPE_IRQ:

/* Length can be 3 or 2 */

if (resource->data.irq.descriptor_length == 2) {
total_size--;
}
break;

case ACPI_RESOURCE_TYPE_START_DEPENDENT:

/* Length can be 1 or 0 */

if (resource->data.irq.descriptor_length == 0) {
total_size--;
}
break;

case ACPI_RESOURCE_TYPE_VENDOR:
/*
* Vendor Defined Resource:
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/resources/rsio.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ struct acpi_rsconvert_info acpi_rs_set_start_dpf[10] = {

/* Reset length to 1 byte (descriptor with flags byte) */

{ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq)},
{ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_start_dependent)},

/*
* All done if flags byte is necessary -- if either priority value
Expand Down

0 comments on commit 66d3ca9

Please sign in to comment.