Skip to content

Commit

Permalink
ALSA: usb - Fix possible Oops at USB-MIDI disconnection
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed Oct 10, 2008
1 parent 669faba commit 7a17daa
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions sound/usb/usbmidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 7a17daa

Please sign in to comment.