aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2013-08-08 03:29:38 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-08-13 07:10:36 -0400
commitbf0dd264b1207b090858e7847919af5f2e367d7c (patch)
tree13dbf445dd4d4c05a28d65cc5da9b695f1a7a11e /drivers/acpi/acpica
parent63660e05ec719613b518547b40a1c501c10f0bc4 (diff)
ACPICA: Fix possible fault for methods that optionally have no return value.
Currently applies to the _WAK method only. If the method has no return value and slack mode is not enabled, the return value validation code can fault. Also improves the error message when an expected return value is missing (for any predefined name/method). The problem fixed here cannot happen on Linux unless acpi=strict is added to the kernel command line. 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/acpica')
-rw-r--r--drivers/acpi/acpica/nspredef.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/drivers/acpi/acpica/nspredef.c b/drivers/acpi/acpica/nspredef.c
index 24b71a01bf93..098e7666cbc9 100644
--- a/drivers/acpi/acpica/nspredef.c
+++ b/drivers/acpi/acpica/nspredef.c
@@ -151,6 +151,15 @@ acpi_ns_check_return_value(struct acpi_namespace_node *node,
151 } 151 }
152 152
153 /* 153 /*
154 *
155 * 4) If there is no return value and it is optional, just return
156 * AE_OK (_WAK).
157 */
158 if (!(*return_object_ptr)) {
159 goto exit;
160 }
161
162 /*
154 * For returned Package objects, check the type of all sub-objects. 163 * For returned Package objects, check the type of all sub-objects.
155 * Note: Package may have been newly created by call above. 164 * Note: Package may have been newly created by call above.
156 */ 165 */
@@ -268,7 +277,12 @@ acpi_ns_check_object_type(struct acpi_evaluate_info *info,
268 277
269 acpi_ut_get_expected_return_types(type_buffer, expected_btypes); 278 acpi_ut_get_expected_return_types(type_buffer, expected_btypes);
270 279
271 if (package_index == ACPI_NOT_PACKAGE_ELEMENT) { 280 if (!return_object) {
281 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
282 info->node_flags,
283 "Expected return object of type %s",
284 type_buffer));
285 } else if (package_index == ACPI_NOT_PACKAGE_ELEMENT) {
272 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname, 286 ACPI_WARN_PREDEFINED((AE_INFO, info->full_pathname,
273 info->node_flags, 287 info->node_flags,
274 "Return type mismatch - found %s, expected %s", 288 "Return type mismatch - found %s, expected %s",