[PATCH 69/73] ACPICA: Fixes for size of StartDependent resource descriptor

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Bob Moore <robert.moore@xxxxxxxxx>

Fixed a couple of size calculation issues with the variable-length
Start Dependent resource descriptor.

Signed-off-by: Bob Moore <robert.moore@xxxxxxxxx>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@xxxxxxx>
Signed-off-by: Len Brown <len.brown@xxxxxxxxx>
---
 drivers/acpi/resources/rscalc.c |   11 +++++++++++
 drivers/acpi/resources/rsio.c   |    2 +-
 2 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/resources/rscalc.c b/drivers/acpi/resources/rscalc.c
index db0a835..d801823 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:
diff --git a/drivers/acpi/resources/rsio.c b/drivers/acpi/resources/rsio.c
index 50f3acd..610d7c2 100644
--- a/drivers/acpi/resources/rsio.c
+++ b/drivers/acpi/resources/rsio.c
@@ -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
-- 
1.5.5.29.g7134

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux