diff options
author | Bob Moore <robert.moore@intel.com> | 2008-04-10 11:06:44 -0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-04-22 19:09:25 -0400 |
commit | 66d3ca9ea28e1b3d591083772fd797b9b46410b8 (patch) | |
tree | 71d34c39cd081e4fe46e024023d3146c8fc9fff3 /drivers/acpi | |
parent | d8846574ed4a81be319bf68728f9cca9af595afd (diff) |
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 <robert.moore@intel.com>
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/resources/rscalc.c | 11 | ||||
-rw-r--r-- | 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 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) | |||
213 | switch (resource->type) { | 213 | switch (resource->type) { |
214 | case ACPI_RESOURCE_TYPE_IRQ: | 214 | case ACPI_RESOURCE_TYPE_IRQ: |
215 | 215 | ||
216 | /* Length can be 3 or 2 */ | ||
217 | |||
216 | if (resource->data.irq.descriptor_length == 2) { | 218 | if (resource->data.irq.descriptor_length == 2) { |
217 | total_size--; | 219 | total_size--; |
218 | } | 220 | } |
219 | break; | 221 | break; |
220 | 222 | ||
223 | case ACPI_RESOURCE_TYPE_START_DEPENDENT: | ||
224 | |||
225 | /* Length can be 1 or 0 */ | ||
226 | |||
227 | if (resource->data.irq.descriptor_length == 0) { | ||
228 | total_size--; | ||
229 | } | ||
230 | break; | ||
231 | |||
221 | case ACPI_RESOURCE_TYPE_VENDOR: | 232 | case ACPI_RESOURCE_TYPE_VENDOR: |
222 | /* | 233 | /* |
223 | * Vendor Defined Resource: | 234 | * Vendor Defined Resource: |
diff --git a/drivers/acpi/resources/rsio.c b/drivers/acpi/resources/rsio.c index 50f3acdd9c8e..610d7c2101f2 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] = { | |||
268 | 268 | ||
269 | /* Reset length to 1 byte (descriptor with flags byte) */ | 269 | /* Reset length to 1 byte (descriptor with flags byte) */ |
270 | 270 | ||
271 | {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_irq)}, | 271 | {ACPI_RSC_LENGTH, 0, 0, sizeof(struct aml_resource_start_dependent)}, |
272 | 272 | ||
273 | /* | 273 | /* |
274 | * All done if flags byte is necessary -- if either priority value | 274 | * All done if flags byte is necessary -- if either priority value |