Skip to content

Commit e9dff11

Browse files
Hans de Goederafaeljw
authored andcommitted
ACPICA: dispatcher: Use acpi_ds_clear_operands() in acpi_ds_call_control_method()
When deleting the previous walkstate operand stack acpi_ds_call_control_method() was deleting obj_desc->Method.param_count operands. But Method.param_count does not necessarily match this_walk_state->num_operands, it may be either less or more. After correcting the for loop to check `i < this_walk_state->num_operands` the code is identical to acpi_ds_clear_operands(), so just outright replace the code with acpi_ds_clear_operands() to fix this. Link: acpica/acpica@53fc0220 Signed-off-by: Hans de Goede <hansg@kernel.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent 22c6557 commit e9dff11

1 file changed

Lines changed: 1 addition & 8 deletions

File tree

drivers/acpi/acpica/dsmethod.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -546,14 +546,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
546546
* Delete the operands on the previous walkstate operand stack
547547
* (they were copied to new objects)
548548
*/
549-
for (i = 0; i < obj_desc->method.param_count; i++) {
550-
acpi_ut_remove_reference(this_walk_state->operands[i]);
551-
this_walk_state->operands[i] = NULL;
552-
}
553-
554-
/* Clear the operand stack */
555-
556-
this_walk_state->num_operands = 0;
549+
acpi_ds_clear_operands(this_walk_state);
557550

558551
ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
559552
"**** Begin nested execution of [%4.4s] **** WalkState=%p\n",

0 commit comments

Comments
 (0)