diff options
Diffstat (limited to 'drivers/acpi/acpica/rsxface.c')
-rw-r--r-- | drivers/acpi/acpica/rsxface.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/acpi/acpica/rsxface.c b/drivers/acpi/acpica/rsxface.c index 15d6eaef0e28..c0e5d2d3ce67 100644 --- a/drivers/acpi/acpica/rsxface.c +++ b/drivers/acpi/acpica/rsxface.c | |||
@@ -563,13 +563,19 @@ acpi_walk_resource_buffer(struct acpi_buffer * buffer, | |||
563 | 563 | ||
564 | while (resource < resource_end) { | 564 | while (resource < resource_end) { |
565 | 565 | ||
566 | /* Sanity check the resource */ | 566 | /* Sanity check the resource type */ |
567 | 567 | ||
568 | if (resource->type > ACPI_RESOURCE_TYPE_MAX) { | 568 | if (resource->type > ACPI_RESOURCE_TYPE_MAX) { |
569 | status = AE_AML_INVALID_RESOURCE_TYPE; | 569 | status = AE_AML_INVALID_RESOURCE_TYPE; |
570 | break; | 570 | break; |
571 | } | 571 | } |
572 | 572 | ||
573 | /* Sanity check the length. It must not be zero, or we loop forever */ | ||
574 | |||
575 | if (!resource->length) { | ||
576 | return_ACPI_STATUS(AE_AML_BAD_RESOURCE_LENGTH); | ||
577 | } | ||
578 | |||
573 | /* Invoke the user function, abort on any error returned */ | 579 | /* Invoke the user function, abort on any error returned */ |
574 | 580 | ||
575 | status = user_function(resource, context); | 581 | status = user_function(resource, context); |