Skip to content

Commit 77700b8

Browse files
committed
ALSA: ump: Fix parsing of 0xFx command
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>
1 parent ab2335d commit 77700b8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

sound/core/ump_convert.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,7 +454,7 @@ static int do_convert_to_ump(struct snd_ump_endpoint *ump,
454454
}
455455

456456
if (c & 0x80) {
457-
bytes = cmd_bytes[(c >> 8) & 7];
457+
bytes = cmd_bytes[(c >> 4) & 7];
458458
cvt->buf[0] = c;
459459
cvt->len = 1;
460460
cvt->cmd_bytes = bytes;

0 commit comments

Comments
 (0)