diff options
author | Chuck Ebbert <cebbert@redhat.com> | 2008-04-16 02:45:05 +0000 |
---|---|---|
committer | Chris Wright <chrisw@sous-sol.org> | 2008-04-18 18:53:30 -0700 |
commit | bcf7b3914e9cd04e09685a1460da8b90e46a8001 (patch) | |
tree | fb033cb32726a66a02afcb340b012e8426550a81 | |
parent | d51b295acd90c52a01b0afb316833c2783e1fb14 (diff) | |
download | kernel-common-bcf7b3914e9cd04e09685a1460da8b90e46a8001.tar.gz kernel-common-bcf7b3914e9cd04e09685a1460da8b90e46a8001.tar.bz2 kernel-common-bcf7b3914e9cd04e09685a1460da8b90e46a8001.zip |
acpi: bus: check once more for an empty list after locking it
upstream commit: f0a37e008750ead1751b7d5e89d220a260a46147
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>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
-rw-r--r-- | drivers/acpi/bus.c | 7 |
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) |