Skip to content

Commit

Permalink
[PATCH] USB: fix oops in acm disconnect
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oliver Neukum authored and Greg Kroah-Hartman committed Feb 1, 2006
1 parent 8e695cd commit 86067ee
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/usb/class/cdc-acm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1014,8 +1014,13 @@ static void acm_disconnect(struct usb_interface *intf)
}

down(&open_sem);
if (!usb_get_intfdata(intf)) {
up(&open_sem);
return;
}
acm->dev = NULL;
usb_set_intfdata (intf, NULL);
usb_set_intfdata(acm->control, NULL);
usb_set_intfdata(acm->data, NULL);

tasklet_disable(&acm->urb_task);

Expand All @@ -1036,7 +1041,7 @@ static void acm_disconnect(struct usb_interface *intf)
for (i = 0; i < ACM_NRB; i++)
usb_buffer_free(usb_dev, acm->readsize, acm->rb[i].base, acm->rb[i].dma);

usb_driver_release_interface(&acm_driver, acm->data);
usb_driver_release_interface(&acm_driver, intf == acm->control ? acm->data : intf);

if (!acm->used) {
acm_tty_unregister(acm);
Expand Down

0 comments on commit 86067ee

Please sign in to comment.