mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 05:02:12 +00:00
USB: fix bug in usb_unlink_anchored_urbs()
Irqs must not accidentally be reenabled. Signed-off-by: Oliver Neukum <oneukum@suse.de> Acked-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
f8033827d8
commit
77571f05a4
@ -601,15 +601,20 @@ EXPORT_SYMBOL_GPL(usb_kill_anchored_urbs);
|
||||
void usb_unlink_anchored_urbs(struct usb_anchor *anchor)
|
||||
{
|
||||
struct urb *victim;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irq(&anchor->lock);
|
||||
spin_lock_irqsave(&anchor->lock, flags);
|
||||
while (!list_empty(&anchor->urb_list)) {
|
||||
victim = list_entry(anchor->urb_list.prev, struct urb,
|
||||
anchor_list);
|
||||
usb_get_urb(victim);
|
||||
spin_unlock_irqrestore(&anchor->lock, flags);
|
||||
/* this will unanchor the URB */
|
||||
usb_unlink_urb(victim);
|
||||
usb_put_urb(victim);
|
||||
spin_lock_irqsave(&anchor->lock, flags);
|
||||
}
|
||||
spin_unlock_irq(&anchor->lock);
|
||||
spin_unlock_irqrestore(&anchor->lock, flags);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(usb_unlink_anchored_urbs);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user