Skip to content

Commit

Permalink
ALSA: ump: Fix parsing of 0xFx command
Browse files Browse the repository at this point in the history
The MIDI 1.0 parser retrieved the 0xFx command with a wrong bit shift,
resulting in the bogus type.  Fix the bit shift size.

Fixes: 0b5288f ("ALSA: ump: Add legacy raw MIDI support")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/r/0fbc0b27-54b8-4cda-800e-37e7a03fed39@kili.mountain
Suggested-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20230525083124.15277-2-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed May 25, 2023
1 parent ab2335d commit 77700b8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/core/ump_convert.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ static int do_convert_to_ump(struct snd_ump_endpoint *ump,
}

if (c & 0x80) {
bytes = cmd_bytes[(c >> 8) & 7];
bytes = cmd_bytes[(c >> 4) & 7];
cvt->buf[0] = c;
cvt->len = 1;
cvt->cmd_bytes = bytes;
Expand Down

0 comments on commit 77700b8

Please sign in to comment.