[PATCH] ACPI: check zero length in acpi_rs_get_aml_length

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

 



There is a bug somewhere in the code that does not set the resource
length. This makes the loop in acpi_rs_get_aml_length to loop forever.
So it is a good thing to have the check even if the bug is fixed.

Signed-off-by: Jiri Slaby <jslaby@xxxxxxx>
---
 drivers/acpi/acpica/rscalc.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c
index da178b4..c128f2e 100644
--- a/drivers/acpi/acpica/rscalc.c
+++ b/drivers/acpi/acpica/rscalc.c
@@ -198,7 +198,8 @@ acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed)
 
 		/* Validate the descriptor type */
 
-		if (resource->type > ACPI_RESOURCE_TYPE_MAX) {
+		if (resource->type > ACPI_RESOURCE_TYPE_MAX ||
+				WARN_ON(!resource->length)) {
 			return_ACPI_STATUS(AE_AML_INVALID_RESOURCE_TYPE);
 		}
 
-- 
1.8.1


--
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