summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/rscalc.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dmitry.torokhov@gmail.com>2013-06-28 08:00:25 +0200
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2013-06-28 08:00:25 +0200
commit31881d74b6dd1a6c530cff61248def4f2da38bee (patch)
treebe62420cf39192074e13b25553d172b9d5e58a33 /drivers/acpi/acpica/rscalc.c
parentInput: wacom_i2c - implement hovering capability (diff)
parentInput: MT - Specify that ABS_MT_SLOT must have a minimum of 0 (diff)
downloadlinux-31881d74b6dd1a6c530cff61248def4f2da38bee.tar.xz
linux-31881d74b6dd1a6c530cff61248def4f2da38bee.zip
Merge branch 'for-next' of git://github.com/rydberg/linux into next
Pull in changes from Henrik: "a trivial MT documentation fix".
Diffstat (limited to 'drivers/acpi/acpica/rscalc.c')
-rw-r--r--drivers/acpi/acpica/rscalc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c
index 7816d4eef04e..72077fa1eea5 100644
--- a/drivers/acpi/acpica/rscalc.c
+++ b/drivers/acpi/acpica/rscalc.c
@@ -202,6 +202,12 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
}
+ /* Sanity check the length. It must not be zero, or we loop forever */
+
+ if (!resource->length) {
+ return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH);
+ }
+
/* Get the base size of the (external stream) resource descriptor */
total_size = acpi_gbl_aml_resource_sizes[resource->type];