diff options
Diffstat (limited to 'drivers/acpi/acpica/exoparg1.c')
-rw-r--r-- | drivers/acpi/acpica/exoparg1.c | 48 |
1 files changed, 42 insertions, 6 deletions
diff --git a/drivers/acpi/acpica/exoparg1.c b/drivers/acpi/acpica/exoparg1.c index 814b4a3d656a..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: |
@@ -990,11 +997,40 @@ acpi_status acpi_ex_opcode_1A_0T_1R(struct acpi_walk_state *walk_state) | |||
990 | acpi_namespace_node | 997 | acpi_namespace_node |
991 | *) | 998 | *) |
992 | return_desc); | 999 | return_desc); |
993 | } | 1000 | if (!return_desc) { |
1001 | break; | ||
1002 | } | ||
994 | 1003 | ||
995 | /* Add another reference to the object! */ | 1004 | /* |
1005 | * June 2013: | ||
1006 | * buffer_fields/field_units require additional resolution | ||
1007 | */ | ||
1008 | switch (return_desc->common.type) { | ||
1009 | case ACPI_TYPE_BUFFER_FIELD: | ||
1010 | case ACPI_TYPE_LOCAL_REGION_FIELD: | ||
1011 | case ACPI_TYPE_LOCAL_BANK_FIELD: | ||
1012 | case ACPI_TYPE_LOCAL_INDEX_FIELD: | ||
996 | 1013 | ||
997 | acpi_ut_add_reference(return_desc); | 1014 | status = |
1015 | acpi_ex_read_data_from_field | ||
1016 | (walk_state, return_desc, | ||
1017 | &temp_desc); | ||
1018 | if (ACPI_FAILURE(status)) { | ||
1019 | goto cleanup; | ||
1020 | } | ||
1021 | |||
1022 | return_desc = temp_desc; | ||
1023 | break; | ||
1024 | |||
1025 | default: | ||
1026 | |||
1027 | /* Add another reference to the object */ | ||
1028 | |||
1029 | acpi_ut_add_reference | ||
1030 | (return_desc); | ||
1031 | break; | ||
1032 | } | ||
1033 | } | ||
998 | break; | 1034 | break; |
999 | 1035 | ||
1000 | default: | 1036 | default: |