]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ACPICA: dispatcher: Use acpi_ds_clear_operands() in acpi_ds_call_control_method()
authorHans de Goede <hansg@kernel.org>
Fri, 12 Sep 2025 20:00:17 +0000 (22:00 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Nov 2025 20:34:05 +0000 (15:34 -0500)
[ Upstream commit e9dff11a7a50fcef23fe3e8314fafae6d5641826 ]

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: https://github.com/acpica/acpica/commit/53fc0220
Signed-off-by: Hans de Goede <hansg@kernel.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/acpi/acpica/dsmethod.c

index a232746d150a7508e94c2a39e60b9c4f387f4d47..dc53a5d700671615756f3faef139873a4bbefef8 100644 (file)
@@ -546,14 +546,7 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
         * Delete the operands on the previous walkstate operand stack
         * (they were copied to new objects)
         */
-       for (i = 0; i < obj_desc->method.param_count; i++) {
-               acpi_ut_remove_reference(this_walk_state->operands[i]);
-               this_walk_state->operands[i] = NULL;
-       }
-
-       /* Clear the operand stack */
-
-       this_walk_state->num_operands = 0;
+       acpi_ds_clear_operands(this_walk_state);
 
        ACPI_DEBUG_PRINT((ACPI_DB_DISPATCH,
                          "**** Begin nested execution of [%4.4s] **** WalkState=%p\n",