Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Oliver Neukum and committed by
Greg Kroah-Hartman
86067eea 8e695cdb

+7 -2
+7 -2
drivers/usb/class/cdc-acm.c
··· 1014 1014 } 1015 1015 1016 1016 down(&open_sem); 1017 + if (!usb_get_intfdata(intf)) { 1018 + up(&open_sem); 1019 + return; 1020 + } 1017 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 1025 tasklet_disable(&acm->urb_task); 1021 1026 ··· 1041 1036 for (i = 0; i < ACM_NRB; i++) 1042 1037 usb_buffer_free(usb_dev, acm->readsize, acm->rb[i].base, acm->rb[i].dma); 1043 1038 1044 - usb_driver_release_interface(&acm_driver, acm->data); 1039 + usb_driver_release_interface(&acm_driver, intf == acm->control ? acm->data : intf); 1045 1040 1046 1041 if (!acm->used) { 1047 1042 acm_tty_unregister(acm);