Commit 66d3ca9e authored by Bob Moore's avatar Bob Moore Committed by Len Brown

ACPICA: Fixes for size of StartDependent resource descriptor

Fixed a couple of size calculation issues with the variable-length
Start Dependent resource descriptor.
Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarAlexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: default avatarLen Brown <len.brown@intel.com>
parent d8846574
...@@ -213,11 +213,22 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) ...@@ -213,11 +213,22 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
switch (resource->type) { switch (resource->type) {
case ACPI_RESOURCE_TYPE_IRQ: case ACPI_RESOURCE_TYPE_IRQ:
/* Length can be 3 or 2 */
if (resource->data.irq.descriptor_length == 2) { if (resource->data.irq.descriptor_length == 2) {
total_size--; total_size--;
} }
break; 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: case ACPI_RESOURCE_TYPE_VENDOR:
/* /*
* Vendor Defined Resource: * Vendor Defined Resource:
......
...@@ -268,7 +268,7 @@ struct acpi_rsconvert_info acpi_rs_set_start_dpf[10] = { ...@@ -268,7 +268,7 @@ struct acpi_rsconvert_info acpi_rs_set_start_dpf[10] = {
/* Reset length to 1 byte (descriptor with flags byte) */ /* 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 * All done if flags byte is necessary -- if either priority value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment