diff options
author | Oliver Neukum <oliver@neukum.org> | 2008-08-18 10:36:52 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-08-21 13:26:32 -0400 |
commit | 77571f05a483c0259e42ba2f482c82debc9a63af (patch) | |
tree | db4624d3c0fba8d3ab94df32ebbc7d8578ca4266 /drivers/usb | |
parent | f8033827d8e92db6159d34ed45c608522674ecd8 (diff) |
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>
Diffstat (limited to 'drivers/usb')
-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 c0b1ae25ae2a..47111e88f791 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 | ||