diff options
Diffstat (limited to 'drivers/usb/class/cdc-wdm.c')
-rw-r--r-- | drivers/usb/class/cdc-wdm.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index a97c018dd419..2b9ff518b509 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c | |||
@@ -542,6 +542,8 @@ static int wdm_open(struct inode *inode, struct file *file) | |||
542 | 542 | ||
543 | mutex_lock(&desc->lock); | 543 | mutex_lock(&desc->lock); |
544 | if (!desc->count++) { | 544 | if (!desc->count++) { |
545 | desc->werr = 0; | ||
546 | desc->rerr = 0; | ||
545 | rv = usb_submit_urb(desc->validity, GFP_KERNEL); | 547 | rv = usb_submit_urb(desc->validity, GFP_KERNEL); |
546 | if (rv < 0) { | 548 | if (rv < 0) { |
547 | desc->count--; | 549 | desc->count--; |
@@ -853,6 +855,18 @@ static int wdm_pre_reset(struct usb_interface *intf) | |||
853 | struct wdm_device *desc = usb_get_intfdata(intf); | 855 | struct wdm_device *desc = usb_get_intfdata(intf); |
854 | 856 | ||
855 | mutex_lock(&desc->lock); | 857 | mutex_lock(&desc->lock); |
858 | kill_urbs(desc); | ||
859 | |||
860 | /* | ||
861 | * we notify everybody using poll of | ||
862 | * an exceptional situation | ||
863 | * must be done before recovery lest a spontaneous | ||
864 | * message from the device is lost | ||
865 | */ | ||
866 | spin_lock_irq(&desc->iuspin); | ||
867 | desc->rerr = -EINTR; | ||
868 | spin_unlock_irq(&desc->iuspin); | ||
869 | wake_up_all(&desc->wait); | ||
856 | return 0; | 870 | return 0; |
857 | } | 871 | } |
858 | 872 | ||