aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi
diff options
context:
space:
mode:
authorChuck Ebbert <cebbert@redhat.com>2008-04-15 17:34:47 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-15 22:35:41 -0400
commitf0a37e008750ead1751b7d5e89d220a260a46147 (patch)
treedb808d329fc56dee2c518a3964f94e25af9941d3 /drivers/acpi
parentd1e7780638a9192f15caf590e0081bf915fdef71 (diff)
acpi: bus: check once more for an empty list after locking it
List could have become empty after the unlocked check that was made earlier, so check again inside the lock. Should fix https://bugzilla.redhat.com/show_bug.cgi?id=427765 Signed-off-by: Chuck Ebbert <cebbert@redhat.com> Cc: <stable@kernel.org> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/acpi')
-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 5b6760e0f957..2d1955c11833 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -373,10 +373,11 @@ int acpi_bus_receive_event(struct acpi_bus_event *event)
373 } 373 }
374 374
375 spin_lock_irqsave(&acpi_bus_event_lock, flags); 375 spin_lock_irqsave(&acpi_bus_event_lock, flags);
376 entry = 376 if (!list_empty(&acpi_bus_event_list)) {
377 list_entry(acpi_bus_event_list.next, struct acpi_bus_event, node); 377 entry = list_entry(acpi_bus_event_list.next,
378 if (entry) 378 struct acpi_bus_event, node);
379 list_del(&entry->node); 379 list_del(&entry->node);
380 }
380 spin_unlock_irqrestore(&acpi_bus_event_lock, flags); 381 spin_unlock_irqrestore(&acpi_bus_event_lock, flags);
381 382
382 if (!entry) 383 if (!entry)