Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95479
b: refs/heads/master
c: 0ba7d25
h: refs/heads/master
i:
  95477: 93e4fbe
  95475: 08c03c4
  95471: 6dc7e1a
v: v3
  • Loading branch information
Bob Moore authored and Len Brown committed Apr 22, 2008
1 parent bdcd7b4 commit ca982a6
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a0144a2929620d9682bc4b0c6274ef03e417f49a
refs/heads/master: 0ba7d25c70699cdd3e06fc049d8884ee54b9d5db
35 changes: 31 additions & 4 deletions trunk/drivers/acpi/dispatcher/dsobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
union acpi_parse_object *parent;
union acpi_operand_object *obj_desc = NULL;
acpi_status status = AE_OK;
acpi_native_uint i;
unsigned i;
u16 index;
u16 reference_count;

Expand Down Expand Up @@ -476,10 +476,37 @@ acpi_ds_build_internal_package_obj(struct acpi_walk_state *walk_state,
arg = arg->common.next;
}

if (!arg) {
/* Check for match between num_elements and actual length of package_list */

if (arg) {
/*
* num_elements was exhausted, but there are remaining elements in the
* package_list.
*
* Note: technically, this is an error, from ACPI spec: "It is an error
* for NumElements to be less than the number of elements in the
* PackageList". However, for now, we just print an error message and
* no exception is returned.
*/
while (arg) {

/* Find out how many elements there really are */

i++;
arg = arg->common.next;
}

ACPI_ERROR((AE_INFO,
"Package List length (%X) larger than NumElements count (%X), truncated\n",
i, element_count));
} else if (i < element_count) {
/*
* Arg list (elements) was exhausted, but we did not reach num_elements count.
* Note: this is not an error, the package is padded out with NULLs.
*/
ACPI_DEBUG_PRINT((ACPI_DB_INFO,
"Package List length larger than NumElements count (%X), truncated\n",
element_count));
"Package List length (%X) smaller than NumElements count (%X), padded with null elements\n",
i, element_count));
}

obj_desc->package.flags |= AOPOBJ_DATA_VALID;
Expand Down

0 comments on commit ca982a6

Please sign in to comment.