summaryrefslogtreecommitdiff
path: root/drivers/acpi/bus.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/bus.c')
-rw-r--r--drivers/acpi/bus.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index f4487c38d9f2..3401e2cfd3ab 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -350,10 +350,11 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
}
spin_lock_irqsave(&acpi_bus_event_lock, flags);
- entry =
- list_entry(acpi_bus_event_list.next, struct acpi_bus_event, node);
- if (entry)
+ if (!list_empty(&acpi_bus_event_list)) {
+ entry = list_entry(acpi_bus_event_list.next,
+ struct acpi_bus_event, node);
list_del(&entry->node);
+ }
spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
if (!entry)