diff options
Diffstat (limited to 'drivers/usb/core/urb.c')
-rw-r--r-- | drivers/usb/core/urb.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index c0b1ae25ae2..47111e88f79 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -601,15 +601,20 @@ EXPORT_SYMBOL_GPL(usb_kill_anchored_urbs); | |||
601 | void usb_unlink_anchored_urbs(struct usb_anchor *anchor) | 601 | void usb_unlink_anchored_urbs(struct usb_anchor *anchor) |
602 | { | 602 | { |
603 | struct urb *victim; | 603 | struct urb *victim; |
604 | unsigned long flags; | ||
604 | 605 | ||
605 | spin_lock_irq(&anchor->lock); | 606 | spin_lock_irqsave(&anchor->lock, flags); |
606 | while (!list_empty(&anchor->urb_list)) { | 607 | while (!list_empty(&anchor->urb_list)) { |
607 | victim = list_entry(anchor->urb_list.prev, struct urb, | 608 | victim = list_entry(anchor->urb_list.prev, struct urb, |
608 | anchor_list); | 609 | anchor_list); |
610 | usb_get_urb(victim); | ||
611 | spin_unlock_irqrestore(&anchor->lock, flags); | ||
609 | /* this will unanchor the URB */ | 612 | /* this will unanchor the URB */ |
610 | usb_unlink_urb(victim); | 613 | usb_unlink_urb(victim); |
614 | usb_put_urb(victim); | ||
615 | spin_lock_irqsave(&anchor->lock, flags); | ||
611 | } | 616 | } |
612 | spin_unlock_irq(&anchor->lock); | 617 | spin_unlock_irqrestore(&anchor->lock, flags); |
613 | } | 618 | } |
614 | EXPORT_SYMBOL_GPL(usb_unlink_anchored_urbs); | 619 | EXPORT_SYMBOL_GPL(usb_unlink_anchored_urbs); |
615 | 620 | ||