aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/nsprepkg.c
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2013-03-08 04:23:51 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-03-11 19:45:05 -0400
commit02d4fb36867c33f7e0cec8d6e6dad47ad712a497 (patch)
tree34b79a95c67e897efa4ff0e7be93247a25918cd9 /drivers/acpi/acpica/nsprepkg.c
parent40411255c89eb382ed695933155a606c000d855e (diff)
ACPICA: Object repair: Allow 0-length packages for variable-length packages
For the predefined names that return fully variable-length packages, allow a zero-length package with no warning, since it is technically a legal construct (and BIOS writers use it.) 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/nsprepkg.c')
-rw-r--r--drivers/acpi/acpica/nsprepkg.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/acpi/acpica/nsprepkg.c b/drivers/acpi/acpica/nsprepkg.c
index a40155467d2e..77cdd539de16 100644
--- a/drivers/acpi/acpica/nsprepkg.c
+++ b/drivers/acpi/acpica/nsprepkg.c
@@ -112,9 +112,15 @@ acpi_ns_check_package(struct acpi_predefined_data *data,
112 elements = return_object->package.elements; 112 elements = return_object->package.elements;
113 count = return_object->package.count; 113 count = return_object->package.count;
114 114
115 /* The package must have at least one element, else invalid */ 115 /*
116 116 * Most packages must have at least one element. The only exception
117 * is the variable-length package (ACPI_PTYPE1_VAR).
118 */
117 if (!count) { 119 if (!count) {
120 if (package->ret_info.type == ACPI_PTYPE1_VAR) {
121 return (AE_OK);
122 }
123
118 ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, data->node_flags, 124 ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, data->node_flags,
119 "Return Package has no elements (empty)")); 125 "Return Package has no elements (empty)"));
120 126