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>
This commit is contained in:
Bob Moore 2013-03-08 09:23:51 +00:00 committed by Rafael J. Wysocki
parent 40411255c8
commit 02d4fb3686
1 changed files with 8 additions and 2 deletions

View File

@ -112,9 +112,15 @@ acpi_ns_check_package(struct acpi_predefined_data *data,
elements = return_object->package.elements;
count = return_object->package.count;
/* The package must have at least one element, else invalid */
/*
* Most packages must have at least one element. The only exception
* is the variable-length package (ACPI_PTYPE1_VAR).
*/
if (!count) {
if (package->ret_info.type == ACPI_PTYPE1_VAR) {
return (AE_OK);
}
ACPI_WARN_PREDEFINED((AE_INFO, data->pathname, data->node_flags,
"Return Package has no elements (empty)"));