]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - sound/usb/usbmidi.c
sched: fix fair preempt check
[linux-2.6-omap-h63xx.git] / sound / usb / usbmidi.c
index c0c7770198ad69782b234b1c77b722e3e61721ca..5962e4b8442394fbe4812c2bfd21a013cf04f29c 100644 (file)
@@ -1112,6 +1112,15 @@ void snd_usbmidi_disconnect(struct list_head* p)
                }
                if (ep->in)
                        usb_kill_urb(ep->in->urb);
+               /* free endpoints here; later call can result in Oops */
+               if (ep->out) {
+                       snd_usbmidi_out_endpoint_delete(ep->out);
+                       ep->out = NULL;
+               }
+               if (ep->in) {
+                       snd_usbmidi_in_endpoint_delete(ep->in);
+                       ep->in = NULL;
+               }
        }
        del_timer_sync(&umidi->error_timer);
 }