aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'sound/usb/midi.c')
-rw-r--r--sound/usb/midi.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sound/usb/midi.c b/sound/usb/midi.c
index 137e1e8718d6..c9c604f0e1ff 100644
--- a/sound/usb/midi.c
+++ b/sound/usb/midi.c
@@ -1211,6 +1211,7 @@ static void snd_usbmidi_output_drain(struct snd_rawmidi_substream *substream)
1211 } while (drain_urbs && timeout); 1211 } while (drain_urbs && timeout);
1212 finish_wait(&ep->drain_wait, &wait); 1212 finish_wait(&ep->drain_wait, &wait);
1213 } 1213 }
1214 port->active = 0;
1214 spin_unlock_irq(&ep->buffer_lock); 1215 spin_unlock_irq(&ep->buffer_lock);
1215} 1216}
1216 1217
@@ -1333,7 +1334,7 @@ static int snd_usbmidi_in_endpoint_create(struct snd_usb_midi *umidi,
1333 1334
1334 error: 1335 error:
1335 snd_usbmidi_in_endpoint_delete(ep); 1336 snd_usbmidi_in_endpoint_delete(ep);
1336 return -ENOMEM; 1337 return err;
1337} 1338}
1338 1339
1339/* 1340/*
@@ -1890,6 +1891,12 @@ static int snd_usbmidi_get_ms_info(struct snd_usb_midi *umidi,
1890 ms_ep = find_usb_ms_endpoint_descriptor(hostep); 1891 ms_ep = find_usb_ms_endpoint_descriptor(hostep);
1891 if (!ms_ep) 1892 if (!ms_ep)
1892 continue; 1893 continue;
1894 if (ms_ep->bLength <= sizeof(*ms_ep))
1895 continue;
1896 if (ms_ep->bNumEmbMIDIJack > 0x10)
1897 continue;
1898 if (ms_ep->bLength < sizeof(*ms_ep) + ms_ep->bNumEmbMIDIJack)
1899 continue;
1893 if (usb_endpoint_dir_out(ep)) { 1900 if (usb_endpoint_dir_out(ep)) {
1894 if (endpoints[epidx].out_ep) { 1901 if (endpoints[epidx].out_ep) {
1895 if (++epidx >= MIDI_MAX_ENDPOINTS) { 1902 if (++epidx >= MIDI_MAX_ENDPOINTS) {
@@ -2142,6 +2149,8 @@ static int snd_usbmidi_detect_roland(struct snd_usb_midi *umidi,
2142 cs_desc[1] == USB_DT_CS_INTERFACE && 2149 cs_desc[1] == USB_DT_CS_INTERFACE &&
2143 cs_desc[2] == 0xf1 && 2150 cs_desc[2] == 0xf1 &&
2144 cs_desc[3] == 0x02) { 2151 cs_desc[3] == 0x02) {
2152 if (cs_desc[4] > 0x10 || cs_desc[5] > 0x10)
2153 continue;
2145 endpoint->in_cables = (1 << cs_desc[4]) - 1; 2154 endpoint->in_cables = (1 << cs_desc[4]) - 1;
2146 endpoint->out_cables = (1 << cs_desc[5]) - 1; 2155 endpoint->out_cables = (1 << cs_desc[5]) - 1;
2147 return snd_usbmidi_detect_endpoints(umidi, endpoint, 1); 2156 return snd_usbmidi_detect_endpoints(umidi, endpoint, 1);