aboutsummaryrefslogtreecommitdiffstats
path: root/sound/core
diff options
context:
space:
mode:
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/seq/seq_midi.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/sound/core/seq/seq_midi.c b/sound/core/seq/seq_midi.c
index 57be9155eb62..4374829ea770 100644
--- a/sound/core/seq/seq_midi.c
+++ b/sound/core/seq/seq_midi.c
@@ -134,7 +134,7 @@ static int event_process_midi(snd_seq_event_t * ev, int direct,
134 seq_midisynth_t *msynth = (seq_midisynth_t *) private_data; 134 seq_midisynth_t *msynth = (seq_midisynth_t *) private_data;
135 unsigned char msg[10]; /* buffer for constructing midi messages */ 135 unsigned char msg[10]; /* buffer for constructing midi messages */
136 snd_rawmidi_substream_t *substream; 136 snd_rawmidi_substream_t *substream;
137 int res; 137 int len;
138 138
139 snd_assert(msynth != NULL, return -EINVAL); 139 snd_assert(msynth != NULL, return -EINVAL);
140 substream = msynth->output_rfile.output; 140 substream = msynth->output_rfile.output;
@@ -146,20 +146,16 @@ static int event_process_midi(snd_seq_event_t * ev, int direct,
146 snd_printd("seq_midi: invalid sysex event flags = 0x%x\n", ev->flags); 146 snd_printd("seq_midi: invalid sysex event flags = 0x%x\n", ev->flags);
147 return 0; 147 return 0;
148 } 148 }
149 res = snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)dump_midi, substream); 149 snd_seq_dump_var_event(ev, (snd_seq_dump_func_t)dump_midi, substream);
150 snd_midi_event_reset_decode(msynth->parser); 150 snd_midi_event_reset_decode(msynth->parser);
151 if (res < 0)
152 return res;
153 } else { 151 } else {
154 if (msynth->parser == NULL) 152 if (msynth->parser == NULL)
155 return -EIO; 153 return -EIO;
156 res = snd_midi_event_decode(msynth->parser, msg, sizeof(msg), ev); 154 len = snd_midi_event_decode(msynth->parser, msg, sizeof(msg), ev);
157 if (res < 0) 155 if (len < 0)
158 return res; 156 return 0;
159 if ((res = dump_midi(substream, msg, res)) < 0) { 157 if (dump_midi(substream, msg, len) < 0)
160 snd_midi_event_reset_decode(msynth->parser); 158 snd_midi_event_reset_decode(msynth->parser);
161 return res;
162 }
163 } 159 }
164 return 0; 160 return 0;
165} 161}