mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-06 22:58:29 +00:00
[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>
This commit is contained in:
parent
8e695cdbff
commit
86067eead5
1 changed files with 7 additions and 2 deletions
|
@ -1014,8 +1014,13 @@ static void acm_disconnect(struct usb_interface *intf)
|
||||||
}
|
}
|
||||||
|
|
||||||
down(&open_sem);
|
down(&open_sem);
|
||||||
|
if (!usb_get_intfdata(intf)) {
|
||||||
|
up(&open_sem);
|
||||||
|
return;
|
||||||
|
}
|
||||||
acm->dev = NULL;
|
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);
|
tasklet_disable(&acm->urb_task);
|
||||||
|
|
||||||
|
@ -1036,7 +1041,7 @@ static void acm_disconnect(struct usb_interface *intf)
|
||||||
for (i = 0; i < ACM_NRB; i++)
|
for (i = 0; i < ACM_NRB; i++)
|
||||||
usb_buffer_free(usb_dev, acm->readsize, acm->rb[i].base, acm->rb[i].dma);
|
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) {
|
if (!acm->used) {
|
||||||
acm_tty_unregister(acm);
|
acm_tty_unregister(acm);
|
||||||
|
|
Loading…
Add table
Reference in a new issue