summaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/evregion.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-03-20 13:25:02 +0100
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-03-20 13:25:02 +0100
commit6ac4a2ab16af49a86ad16bdab1de72d5b809a9c1 (patch)
tree6cdaa76dbcdfe070e293b3d6ab4c78649c8ed059 /drivers/acpi/acpica/evregion.c
parent94a81caca3757a2eda026cbd592db8e321fcba43 (diff)
parent6e596084833b95662dfe90e1f30d83ccbd64575c (diff)
Merge branch 'acpica'
* acpica: (29 commits) ACPICA: Revert "Headers: Deploy #pragma pack (push) and (pop)." ACPICA: Update version to 20140214. ACPICA: Prevent infinite loops when traversing corrupted lists. ACPICA: Debugger: Add missing objects; Traverse linked lists ACPICA: Add text: ACPICA policy for new _OSI strings. No functional change. ACPICA: Update for _PRP predefined name. ACPICA: Cleanup/improve global variable declarations. ACPICA: Comment update - no functional change. ACPICA: Do not abort _PRT repair on a single subpackage failure. ACPICA: Harden _PRT repair code; check for minimum package length. ACPICA: Restore code that repairs NULL package elements in return values. ACPICA: Properly handle NULL entries in _PRT return packages. ACPICA: Update conditional compilation flags for resource dump functions. ACPICA: Predefined names: Add support for the _PRP method. ACPICA: Headers: Deploy #pragma pack (push) and (pop). ACPICA: Add boot option to disable auto return object repair ACPICA: acpidump: Remove integer types translation protection. ACPICA: acpidump: Add sparse declarators support. ACPICA: Add "Windows 2013" string to _OSI support. ACPICA: Update version to 20140114. ...
Diffstat (limited to 'drivers/acpi/acpica/evregion.c')
-rw-r--r--drivers/acpi/acpica/evregion.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/acpi/acpica/evregion.c b/drivers/acpi/acpica/evregion.c
index 144cbb9b73b..9957297d158 100644
--- a/drivers/acpi/acpica/evregion.c
+++ b/drivers/acpi/acpica/evregion.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
@@ -314,6 +314,7 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
{
union acpi_operand_object *handler_obj;
union acpi_operand_object *obj_desc;
+ union acpi_operand_object *start_desc;
union acpi_operand_object **last_obj_ptr;
acpi_adr_space_setup region_setup;
void **region_context;
@@ -341,6 +342,7 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
/* Find this region in the handler's list */
obj_desc = handler_obj->address_space.region_list;
+ start_desc = obj_desc;
last_obj_ptr = &handler_obj->address_space.region_list;
while (obj_desc) {
@@ -438,6 +440,15 @@ acpi_ev_detach_region(union acpi_operand_object *region_obj,
last_obj_ptr = &obj_desc->region.next;
obj_desc = obj_desc->region.next;
+
+ /* Prevent infinite loop if list is corrupted */
+
+ if (obj_desc == start_desc) {
+ ACPI_ERROR((AE_INFO,
+ "Circular handler list in region object %p",
+ region_obj));
+ return_VOID;
+ }
}
/* If we get here, the region was not in the handler's region list */