From 724097059a8e5df1aa162d153b8f90b0ffbb82dc Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Thu, 15 Oct 2015 21:17:11 +0300 Subject: [PATCH 52/52] ALSA: firewire-tascam: off by one in handle_midi_tx() My static checker complains because tscm->spec->midi_capture_ports is either 2 or 4 but the tscm->tx_midi_substreams[] array has 4 elements so this is possibly off by one. I have looked at the code and I think it should be >= instead of > as well. Fixes: 107cc0129a68 ('ALSA: firewire-tascam: add support for incoming MIDI messages by asynchronous transaction') Signed-off-by: Dan Carpenter Signed-off-by: Takashi Iwai --- sound/firewire/tascam/tascam-transaction.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/tascam/tascam-transaction.c b/sound/firewire/tascam/tascam-transaction.c index 45c3ce3d6020..d4f64ae182e7 100644 --- a/sound/firewire/tascam/tascam-transaction.c +++ b/sound/firewire/tascam/tascam-transaction.c @@ -158,7 +158,7 @@ static void handle_midi_tx(struct fw_card *card, struct fw_request *request, port = b[0] >> 4; /* TODO: support virtual MIDI ports. */ - if (port > tscm->spec->midi_capture_ports) + if (port >= tscm->spec->midi_capture_ports) goto end; /* Assume the message length. */ -- 2.4.10