From: Erik Schmauss Date: Mon, 5 Jun 2017 08:41:43 +0000 (+0800) Subject: ACPICA: Disassembler: prevent external op's from opening a new scope X-Git-Tag: v4.13-rc1~173^2~2^2~1^2~8 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=2f8c1141da2f53989e1ace6806ab45a385d24487;p=karo-tx-linux.git ACPICA: Disassembler: prevent external op's from opening a new scope ACPICA commit c512c2bfcce65b8e8f37d549ac2fa4a1e0182e46 Since Externals could be of ACPI_TYPE_METHOD, there is a possibility that the acpi_ns_lookup may cause a new scope to be opened. Therefore, disable opening the scope for all acpi_ns_lookup invocations that deal with externals. Link: https://github.com/acpica/acpica/commit/c512c2bf Signed-off-by: Erik Schmauss Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/acpi/acpica/dswload2.c b/drivers/acpi/acpica/dswload2.c index 8d510c7e20c8..ab5d318975f4 100644 --- a/drivers/acpi/acpica/dswload2.c +++ b/drivers/acpi/acpica/dswload2.c @@ -310,6 +310,16 @@ acpi_ds_load2_begin_op(struct acpi_walk_state *walk_state, flags |= ACPI_NS_TEMPORARY; } } +#ifdef ACPI_ASL_COMPILER + + /* + * Do not open a scope. This could be an external method + * and open a scope. + */ + if (walk_state->opcode == AML_EXTERNAL_OP) { + flags |= ACPI_NS_DONT_OPEN_SCOPE; + } +#endif /* Add new entry or lookup existing entry */