From 66d3ca9ea28e1b3d591083772fd797b9b46410b8 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Thu, 10 Apr 2008 19:06:44 +0400 Subject: 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: Bob Moore Signed-off-by: Alexey Starikovskiy Signed-off-by: Len Brown --- drivers/acpi/resources/rscalc.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'drivers/acpi/resources/rscalc.c') diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c index db0a835e3317..d801823de016 100644 --- a/drivers/acpi/resources/rscalc.c +++ b/drivers/acpi/resources/rscalc.c @@ -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: -- cgit v1.2.2