ALSA: firewire-tascam: off by one in handle_midi_tx()
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 15 Oct 2015 18:17:11 +0000 (21:17 +0300)
committerTakashi Iwai <tiwai@suse.de>
Sat, 17 Oct 2015 10:06:28 +0000 (12:06 +0200)
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 <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/firewire/tascam/tascam-transaction.c

index 45c3ce3d6020c985c89cf94c995d736a2aff8375..d4f64ae182e730820856765b9f662bff6fe97a7a 100644 (file)
@@ -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. */