summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-10-02 14:50:22 +0200
committerJaroslav Kysela <perex@perex.cz>2008-10-10 13:41:48 +0200
commit7a17daae8ed71bf3259d905a4fc48a5b424fa935 (patch)
tree98c6208065121b01b2332a181c3c17acc1cca547 /sound
parent669faba27f2f7b04b9228d20e30e7f584f0becd5 (diff)
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 <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound')
-rw-r--r--sound/usb/usbmidi.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/usb/usbmidi.c b/sound/usb/usbmidi.c
index c0c7770198a..5962e4b8442 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);
}