diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c index 220d6406c9e93cbd7ed269fca5adbd94e3303152..5e8fed448850fc1c8f50448f6b344066d2e730ef 100644 --- a/drivers/acpi/ec.c +++ b/drivers/acpi/ec.c @@ -861,7 +861,7 @@ void acpi_ec_remove_query_handler(struct acpi_ec *ec, u8 query_bit) } } mutex_unlock(&ec->mutex); - list_for_each_entry(handler, &free_list, node) + list_for_each_entry_safe(handler, tmp, &free_list, node) acpi_ec_put_query_handler(handler); } EXPORT_SYMBOL_GPL(acpi_ec_remove_query_handler);