1
0
Fork 0

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>
hifive-unleashed-5.1
Takashi Iwai 2008-10-02 14:50:22 +02:00 committed by Jaroslav Kysela
parent 669faba27f
commit 7a17daae8e
1 changed files with 9 additions and 0 deletions

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