aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2017-04-26 04:18:16 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-04-26 18:31:00 -0400
commited7f8bc91a8df96662b21accc9a5abe2c292014a (patch)
tree031ae247405fbeffbb443dc202a592593a3bca20
parent3b2d69114fefa474fca542e51119036dceb4aa6f (diff)
ACPICA: Update for automatic repair code for objects returned by evaluate_object
ACPICA commit 6b58810b9aad7358fbf1a0f4057fefa8d29838d3 This change fixes two instances where the repair code made an incorrect assumption about how reference counts are assigned to package objects. Resolves issues where a warning was issued about a "large reference count" -- which usually indicates an attempt to delete an object that has previously been poisoned and released into the object cache. Link: https://github.com/acpica/acpica/commit/6b58810b Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpica/nsrepair.c16
-rw-r--r--drivers/acpi/acpica/nsrepair2.c6
2 files changed, 4 insertions, 18 deletions
diff --git a/drivers/acpi/acpica/nsrepair.c b/drivers/acpi/acpica/nsrepair.c
index 38316266521e..418ef2ac82ab 100644
--- a/drivers/acpi/acpica/nsrepair.c
+++ b/drivers/acpi/acpica/nsrepair.c
@@ -290,22 +290,12 @@ object_repaired:
290 /* Object was successfully repaired */ 290 /* Object was successfully repaired */
291 291
292 if (package_index != ACPI_NOT_PACKAGE_ELEMENT) { 292 if (package_index != ACPI_NOT_PACKAGE_ELEMENT) {
293 /* 293
294 * The original object is a package element. We need to 294 /* Update reference count of new object */
295 * decrement the reference count of the original object, 295
296 * for removing it from the package.
297 *
298 * However, if the original object was just wrapped with a
299 * package object as part of the repair, we don't need to
300 * change the reference count.
301 */
302 if (!(info->return_flags & ACPI_OBJECT_WRAPPED)) { 296 if (!(info->return_flags & ACPI_OBJECT_WRAPPED)) {
303 new_object->common.reference_count = 297 new_object->common.reference_count =
304 return_object->common.reference_count; 298 return_object->common.reference_count;
305
306 if (return_object->common.reference_count > 1) {
307 return_object->common.reference_count--;
308 }
309 } 299 }
310 300
311 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR, 301 ACPI_DEBUG_PRINT((ACPI_DB_REPAIR,
diff --git a/drivers/acpi/acpica/nsrepair2.c b/drivers/acpi/acpica/nsrepair2.c
index 352265498e90..06037e044694 100644
--- a/drivers/acpi/acpica/nsrepair2.c
+++ b/drivers/acpi/acpica/nsrepair2.c
@@ -403,16 +403,12 @@ acpi_ns_repair_CID(struct acpi_evaluate_info *info,
403 return (status); 403 return (status);
404 } 404 }
405 405
406 /* Take care with reference counts */
407
408 if (original_element != *element_ptr) { 406 if (original_element != *element_ptr) {
409 407
410 /* Element was replaced */ 408 /* Update reference count of new object */
411 409
412 (*element_ptr)->common.reference_count = 410 (*element_ptr)->common.reference_count =
413 original_ref_count; 411 original_ref_count;
414
415 acpi_ut_remove_reference(original_element);
416 } 412 }
417 413
418 element_ptr++; 414 element_ptr++;