Commit 0253fc47 authored by Andy Grover's avatar Andy Grover

ACPI: Handle P_BLK lengths shorter than 6 more gracefully

parent 7e13b754
...@@ -1607,15 +1607,19 @@ acpi_processor_get_info ( ...@@ -1607,15 +1607,19 @@ acpi_processor_get_info (
if (!object.processor.pblk_address) if (!object.processor.pblk_address)
ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n")); ACPI_DEBUG_PRINT((ACPI_DB_INFO, "No PBLK (NULL address)\n"));
else if (object.processor.pblk_length < 6) else if (object.processor.pblk_length < 4)
ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid PBLK length [%d]\n", ACPI_DEBUG_PRINT((ACPI_DB_ERROR, "Invalid PBLK length [%d]\n",
object.processor.pblk_length)); object.processor.pblk_length));
else { else {
pr->throttling.address = object.processor.pblk_address; pr->throttling.address = object.processor.pblk_address;
pr->throttling.duty_offset = acpi_fadt.duty_offset; pr->throttling.duty_offset = acpi_fadt.duty_offset;
pr->throttling.duty_width = acpi_fadt.duty_width; pr->throttling.duty_width = acpi_fadt.duty_width;
if (object.processor.pblk_length >= 5)
pr->power.states[ACPI_STATE_C2].address = pr->power.states[ACPI_STATE_C2].address =
object.processor.pblk_address + 4; object.processor.pblk_address + 4;
if (object.processor.pblk_length >= 6)
pr->power.states[ACPI_STATE_C3].address = pr->power.states[ACPI_STATE_C3].address =
object.processor.pblk_address + 5; object.processor.pblk_address + 5;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment