aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/class
diff options
context:
space:
mode:
authorOliver Neukum <oliver@neukum.org>2006-01-08 06:39:13 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-01-31 20:23:37 -0500
commit86067eead5a6c6fa413ef5cb59f7129f5ed80292 (patch)
tree4861c4ce892c0485beb1810aa346f18833dd9b85 /drivers/usb/class
parent8e695cdbffe66f5d3142a363f47053be9f83a90d (diff)
[PATCH] USB: fix oops in acm disconnect
this fixes an oops with disconnection in acm. Signed-off-by: Oliver Neukum <oliver@neukum.name> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/class')
-rw-r--r--drivers/usb/class/cdc-acm.c9
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);