diff options
Diffstat (limited to 'drivers/acpi/acpica/rscalc.c')
| -rw-r--r-- | drivers/acpi/acpica/rscalc.c | 13 | 
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/acpi/acpica/rscalc.c b/drivers/acpi/acpica/rscalc.c index b62a0f4f4f9..689556744b0 100644 --- a/drivers/acpi/acpica/rscalc.c +++ b/drivers/acpi/acpica/rscalc.c @@ -5,7 +5,7 @@   ******************************************************************************/  /* - * Copyright (C) 2000 - 2013, Intel Corp. + * Copyright (C) 2000 - 2014, Intel Corp.   * All rights reserved.   *   * Redistribution and use in source and binary forms, with or without @@ -174,6 +174,7 @@ acpi_rs_stream_option_length(u32 resource_length,   * FUNCTION:    acpi_rs_get_aml_length   *   * PARAMETERS:  resource            - Pointer to the resource linked list + *              resource_list_size  - Size of the resource linked list   *              size_needed         - Where the required size is returned   *   * RETURN:      Status @@ -185,16 +186,20 @@ acpi_rs_stream_option_length(u32 resource_length,   ******************************************************************************/  acpi_status -acpi_rs_get_aml_length(struct acpi_resource * resource, acpi_size * size_needed) +acpi_rs_get_aml_length(struct acpi_resource *resource, +		       acpi_size resource_list_size, acpi_size * size_needed)  {  	acpi_size aml_size_needed = 0; +	struct acpi_resource *resource_end;  	acpi_rs_length total_size;  	ACPI_FUNCTION_TRACE(rs_get_aml_length);  	/* Traverse entire list of internal resource descriptors */ -	while (resource) { +	resource_end = +	    ACPI_ADD_PTR(struct acpi_resource, resource, resource_list_size); +	while (resource < resource_end) {  		/* Validate the descriptor type */ @@ -631,7 +636,7 @@ acpi_rs_get_pci_routing_table_length(union acpi_operand_object *package_object,  	for (index = 0; index < number_of_elements; index++) { -		/* Dereference the sub-package */ +		/* Dereference the subpackage */  		package_element = *top_object_list;  | 
