mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-30 08:02:30 +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
1 changed files with 7 additions and 2 deletions
|
@ -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 a new issue