Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331726
b: refs/heads/master
c: 369d913
h: refs/heads/master
v: v3
  • Loading branch information
Fenghua Yu authored and Len Brown committed Oct 6, 2012
1 parent a60d00d commit b420843
Show file tree
Hide file tree
Showing 2 changed files with 15 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: fc54ab72959edbf229b65ac74b2f122d799ca002
refs/heads/master: 369d913b242cae2205471b11b6e33ac368ed33ec
18 changes: 14 additions & 4 deletions trunk/drivers/acpi/tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,10 +240,17 @@ acpi_table_parse_entries(char *id,
table_end) {
if (entry->type == entry_id
&& (!max_entries || count++ < max_entries))
if (handler(entry, table_end)) {
early_acpi_os_unmap_memory((char *)table_header, tbl_size);
return -EINVAL;
}
if (handler(entry, table_end))
goto err;

/*
* If entry->length is 0, break from this loop to avoid
* infinite loop.
*/
if (entry->length == 0) {
pr_err(PREFIX "[%4.4s:0x%02x] Invalid zero length\n", id, entry_id);
goto err;
}

entry = (struct acpi_subtable_header *)
((unsigned long)entry + entry->length);
Expand All @@ -255,6 +262,9 @@ acpi_table_parse_entries(char *id,

early_acpi_os_unmap_memory((char *)table_header, tbl_size);
return count;
err:
early_acpi_os_unmap_memory((char *)table_header, tbl_size);
return -EINVAL;
}

int __init
Expand Down

0 comments on commit b420843

Please sign in to comment.