--- x/sound/usb/midi.c +++ y/sound/usb/midi.c @@ -1145,6 +1145,11 @@ static int snd_usbmidi_output_open(struc static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream) { + if (substream->runtime && + substream->runtime->private_data) { + struct usbmidi_out_port *port = substream->runtime->private_data; + cancel_work_sync(&port->ep->work); + } return substream_open(substream, 0, 0); }