提交 f0a37e00 编写于 作者: C Chuck Ebbert 提交者: Linus Torvalds

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=427765Signed-off-by: NChuck Ebbert <cebbert@redhat.com>
Cc: <stable@kernel.org>
Cc: Len Brown <lenb@kernel.org>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 d1e77806
......@@ -373,10 +373,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)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册