aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2017-04-26 04:17:43 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-04-26 18:30:58 -0400
commitda28e1955d7fc228870f437693cfae8ce486ad9f (patch)
treef40b3ef5f511eeb696729e37202e5ae7f293ab87
parentf202f65dd4d1dba1d3fb9c48c6a5b0725367881d (diff)
ACPICA: Disassembler: Enhance resource descriptor detection
ACPICA commit ba5020b2dbe1538e4ccd7ac2dfd8843a690c007f This change enhances the detection of resource descriptors within a buffer object. For the end_tag opcode, the second byte is defined to be either a checksum or zero. All known ASL compilers insert a zero for this byte. The disassembler now ensures this byte is zero before deciding that a buffer should be disassembled to a resource descriptor. This helps eliminate incorrect decisions when attempting to disassemble a buffer to a resource descriptor. Link: https://github.com/acpica/acpica/commit/ba5020b2 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/utresrc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/utresrc.c b/drivers/acpi/acpica/utresrc.c
index ff096d9755b9..e0587c85bafd 100644
--- a/drivers/acpi/acpica/utresrc.c
+++ b/drivers/acpi/acpica/utresrc.c
@@ -474,6 +474,15 @@ acpi_ut_walk_aml_resources(struct acpi_walk_state *walk_state,
474 return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG); 474 return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
475 } 475 }
476 476
477 /*
478 * The end_tag opcode must be followed by a zero byte.
479 * Although this byte is technically defined to be a checksum,
480 * in practice, all ASL compilers set this byte to zero.
481 */
482 if (*(aml + 1) != 0) {
483 return_ACPI_STATUS(AE_AML_NO_RESOURCE_END_TAG);
484 }
485
477 /* Return the pointer to the end_tag if requested */ 486 /* Return the pointer to the end_tag if requested */
478 487
479 if (!user_function) { 488 if (!user_function) {