diff options
author | Bob Moore <robert.moore@intel.com> | 2008-07-04 06:57:51 +0400 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2008-10-23 07:14:36 +0400 |
commit | a6f30539f31a8129288b0e5640d3eb1174848c15 (patch) | |
tree | 5a8210fee6445161bd44ef3bead4b86828d47d15 /drivers/acpi/tables | |
parent | 9db4fcd99f7ef886ded97cd26a8642c70fbe34df (diff) | |
download | linux-a6f30539f31a8129288b0e5640d3eb1174848c15.tar.xz |
ACPICA: Fix table compare code, length then data
Split the ACPI table compare. First check that the lengths match
exactly. Then compare the data.
Signed-off-by: Bob Moore <robert.moore@intel.com>
Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
Diffstat (limited to 'drivers/acpi/tables')
-rw-r--r-- | drivers/acpi/tables/tbinstal.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c index 905dc38ab23b..18747ce8dd2f 100644 --- a/drivers/acpi/tables/tbinstal.c +++ b/drivers/acpi/tables/tbinstal.c @@ -110,7 +110,6 @@ acpi_status acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) { u32 i; - u32 length; acpi_status status = AE_OK; ACPI_FUNCTION_TRACE(tb_add_table); @@ -145,13 +144,18 @@ acpi_tb_add_table(struct acpi_table_desc *table_desc, u32 *table_index) } } - /* Check for a table match on the entire table length */ + /* + * Check for a table match on the entire table length, + * not just the header. + */ + if (table_desc->length != + acpi_gbl_root_table_list.tables[i].length) { + continue; + } - length = ACPI_MIN(table_desc->length, - acpi_gbl_root_table_list.tables[i].length); if (ACPI_MEMCMP(table_desc->pointer, acpi_gbl_root_table_list.tables[i].pointer, - length)) { + acpi_gbl_root_table_list.tables[i].length)) { continue; } |