Commit 7a17daae authored by Takashi Iwai's avatar Takashi Iwai Committed by Jaroslav Kysela

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: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarJaroslav Kysela <perex@perex.cz>
parent 669faba2
...@@ -1112,6 +1112,15 @@ void snd_usbmidi_disconnect(struct list_head* p) ...@@ -1112,6 +1112,15 @@ void snd_usbmidi_disconnect(struct list_head* p)
} }
if (ep->in) if (ep->in)
usb_kill_urb(ep->in->urb); 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); del_timer_sync(&umidi->error_timer);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment