diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/usb/class/cdc-acm.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index b9fd39fd1b5b..97bdeb1c2181 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1014,8 +1014,13 @@ static void acm_disconnect(struct usb_interface *intf) | |||
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | down(&open_sem); | 1016 | down(&open_sem); |
1017 | if (!usb_get_intfdata(intf)) { | ||
1018 | up(&open_sem); | ||
1019 | return; | ||
1020 | } | ||
1017 | acm->dev = NULL; | 1021 | acm->dev = NULL; |
1018 | usb_set_intfdata (intf, NULL); | 1022 | usb_set_intfdata(acm->control, NULL); |
1023 | usb_set_intfdata(acm->data, NULL); | ||
1019 | 1024 | ||
1020 | tasklet_disable(&acm->urb_task); | 1025 | tasklet_disable(&acm->urb_task); |
1021 | 1026 | ||
@@ -1036,7 +1041,7 @@ static void acm_disconnect(struct usb_interface *intf) | |||
1036 | for (i = 0; i < ACM_NRB; i++) | 1041 | for (i = 0; i < ACM_NRB; i++) |
1037 | usb_buffer_free(usb_dev, acm->readsize, acm->rb[i].base, acm->rb[i].dma); | 1042 | usb_buffer_free(usb_dev, acm->readsize, acm->rb[i].base, acm->rb[i].dma); |
1038 | 1043 | ||
1039 | usb_driver_release_interface(&acm_driver, acm->data); | 1044 | usb_driver_release_interface(&acm_driver, intf == acm->control ? acm->data : intf); |
1040 | 1045 | ||
1041 | if (!acm->used) { | 1046 | if (!acm->used) { |
1042 | acm_tty_unregister(acm); | 1047 | acm_tty_unregister(acm); |