From: Dan Carpenter Date: Fri, 25 Jan 2019 12:44:18 +0000 (+0300) Subject: ALSA: fireface: Off by one in latter_handle_midi_msg() X-Git-Tag: v5.1-rc1~22^2~70 X-Git-Url: https://git.kernel.dk/?a=commitdiff_plain;h=2dee43ec3f31de39dc74e76e6ed65d976f486df0;p=linux-block.git ALSA: fireface: Off by one in latter_handle_midi_msg() The > should be >= or otherwise we potentially read one element beyond the end of the ff->tx_midi_substreams[] array. Fixes: 73f5537fb209 ("ALSA: fireface: support tx MIDI functionality of Fireface UCX") Signed-off-by: Dan Carpenter Reviewed-by: Takashi Sakamoto Signed-off-by: Takashi Iwai --- diff --git a/sound/firewire/fireface/ff-protocol-latter.c b/sound/firewire/fireface/ff-protocol-latter.c index 0fbc1950327f..c8236ff89b7f 100644 --- a/sound/firewire/fireface/ff-protocol-latter.c +++ b/sound/firewire/fireface/ff-protocol-latter.c @@ -293,7 +293,7 @@ static void latter_handle_midi_msg(struct snd_ff *ff, unsigned int offset, struct snd_rawmidi_substream *substream; unsigned int len; - if (index > ff->spec->midi_in_ports) + if (index >= ff->spec->midi_in_ports) return; switch (data & 0x0000000f) {