aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/ec.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
index 71caa7d983a..b649ac7122a 100644
--- a/drivers/acpi/ec.c
+++ b/drivers/acpi/ec.c
@@ -730,14 +730,14 @@ static int acpi_ec_add(struct acpi_device *device)
static int acpi_ec_remove(struct acpi_device *device, int type)
{
struct acpi_ec *ec;
- struct acpi_ec_query_handler *handler;
+ struct acpi_ec_query_handler *handler, *tmp;
if (!device)
return -EINVAL;
ec = acpi_driver_data(device);
mutex_lock(&ec->lock);
- list_for_each_entry(handler, &ec->list, node) {
+ list_for_each_entry_safe(handler, tmp, &ec->list, node) {
list_del(&handler->node);
kfree(handler);
}