mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
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 <[email protected]> Signed-off-by: Lin Ming <[email protected]> Signed-off-by: Andi Kleen <[email protected]> Signed-off-by: Len Brown <[email protected]>
This commit is contained in:
parent
9db4fcd99f
commit
a6f30539f3
1 changed files with 9 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue