[PATCH 2/2] ALSA: ump: Fix parsing of 0xFx command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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: 0b5288f5fe63 ("ALSA: ump: Add legacy raw MIDI support")
Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Closes: https://lore.kernel.org/r/0fbc0b27-54b8-4cda-800e-37e7a03fed39@kili.mountain
Suggested-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Takashi Iwai <tiwai@xxxxxxx>
---
 sound/core/ump_convert.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/core/ump_convert.c b/sound/core/ump_convert.c
index 164829d3e305..48ab3e1bd62e 100644
--- a/sound/core/ump_convert.c
+++ b/sound/core/ump_convert.c
@@ -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;
-- 
2.35.3




[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Pulse Audio]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux