}
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);
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);