Skip to content

Commit 720ef73

Browse files
pyma1andy-shev
authored andcommitted
platform/x86: thinkpad_acpi: re-initialize ACPI buffer size when reuse
Evaluating ACPI _BCL could fail, then ACPI buffer size will be set to 0. When reuse this ACPI buffer, AE_BUFFER_OVERFLOW will be triggered. Re-initialize buffer size will make ACPI evaluate successfully. Fixes: 46445b6 ("thinkpad-acpi: fix handle locate for video and query of _BCL") Signed-off-by: Aaron Ma <[email protected]> Signed-off-by: Andy Shevchenko <[email protected]>
1 parent 9fb7779 commit 720ef73

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/platform/x86/thinkpad_acpi.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6829,8 +6829,10 @@ static int __init tpacpi_query_bcl_levels(acpi_handle handle)
68296829
list_for_each_entry(child, &device->children, node) {
68306830
acpi_status status = acpi_evaluate_object(child->handle, "_BCL",
68316831
NULL, &buffer);
6832-
if (ACPI_FAILURE(status))
6832+
if (ACPI_FAILURE(status)) {
6833+
buffer.length = ACPI_ALLOCATE_BUFFER;
68336834
continue;
6835+
}
68346836

68356837
obj = (union acpi_object *)buffer.pointer;
68366838
if (!obj || (obj->type != ACPI_TYPE_PACKAGE)) {

0 commit comments

Comments
 (0)