From: Takashi Iwai Date: Thu, 2 Oct 2008 12:50:22 +0000 (+0200) Subject: ALSA: usb - Fix possible Oops at USB-MIDI disconnection X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7a17daae8ed71bf3259d905a4fc48a5b424fa935;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git ALSA: usb - Fix possible Oops at USB-MIDI disconnection The endpoints should be released immediately at disconnection rather than the delayed release. This could be a reason of Oops at USB-audio device disconnection being used. Signed-off-by: Takashi Iwai Signed-off-by: Jaroslav Kysela --- diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c index c0c7770198ad..5962e4b84423 100644 --- a/sound/usb/usbmidi.c +++ b/sound/usb/usbmidi.c @@ -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); }