mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 02:32:09 -04:00
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 <[email protected]> Cc: <[email protected]> Cc: Len Brown <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
d1e7780638
commit
f0a37e0087
1 changed files with 4 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue