diff options
author | Bob Moore <robert.moore@intel.com> | 2013-08-08 03:29:58 -0400 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2013-08-13 07:14:15 -0400 |
commit | a50abf4842dd7d603a2ad6dcc7f1467fd2a66f03 (patch) | |
tree | e872ae70215498c551be7048c61cf4ea1c0b2233 /drivers/acpi | |
parent | 1d82980c99ef2a91459ea39627d8114befb2c895 (diff) |
ACPICA: Return error if DerefOf resolves to a null package element.
Disallow the dereference of a reference (via index) to an uninitialized
package element. Provides compatibility with other ACPI
implementations. ACPICA BZ 1003.
References: https://bugs.acpica.org/show_bug.cgi?id=431
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>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpica/exoparg1.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c index 3482df4a69f9..2cdd41d8ade6 100644 --- a/drivers/acpi/acpica/exoparg1.c +++ b/drivers/acpi/acpica/exoparg1.c | |||
@@ -962,10 +962,17 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) | |||
962 | */ | 962 | */ |
963 | return_desc = | 963 | return_desc = |
964 | *(operand[0]->reference.where); | 964 | *(operand[0]->reference.where); |
965 | if (return_desc) { | 965 | if (!return_desc) { |
966 | acpi_ut_add_reference | 966 | /* |
967 | (return_desc); | 967 | * Element is NULL, do not allow the dereference. |
968 | * This provides compatibility with other ACPI | ||
969 | * implementations. | ||
970 | */ | ||
971 | return_ACPI_STATUS | ||
972 | (AE_AML_UNINITIALIZED_ELEMENT); | ||
968 | } | 973 | } |
974 | |||
975 | acpi_ut_add_reference(return_desc); | ||
969 | break; | 976 | break; |
970 | 977 | ||
971 | default: | 978 | default: |