Commit af65d98b authored by Takashi Iwai's avatar Takashi Iwai Committed by Ma Wupeng
Browse files

ALSA: seq: Fix incorrect UMP type for system messages

stable inclusion
from stable-v6.6.34
commit b48f81d2c3dcaf273aeeefb81a0a9fcacf5e1c95
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IAD6H2

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b48f81d2c3dcaf273aeeefb81a0a9fcacf5e1c95

--------------------------------

commit edb32776196afa393c074d6a2733e3a69e66b299 upstream.

When converting a legacy system message to a UMP packet, it forgot to
modify the UMP type field but keeping the default type (either type 2
or 4).  Correct to the right type for system messages.

Fixes: e9e02819 ("ALSA: seq: Automatic conversion of UMP events")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20240529083800.5742-1-tiwai@suse.de


Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarWang Hai <wanghai38@huawei.com>
parent 0f1b6212
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -740,6 +740,7 @@ static int system_1p_ev_to_ump_midi1(const struct snd_seq_event *event,
				     union snd_ump_midi1_msg *data,
				     unsigned char status)
{
	data->system.type = UMP_MSG_TYPE_SYSTEM; // override
	data->system.status = status;
	data->system.parm1 = event->data.control.value & 0x7f;
	return 1;
@@ -751,6 +752,7 @@ static int system_2p_ev_to_ump_midi1(const struct snd_seq_event *event,
				     union snd_ump_midi1_msg *data,
				     unsigned char status)
{
	data->system.type = UMP_MSG_TYPE_SYSTEM; // override
	data->system.status = status;
	data->system.parm1 = event->data.control.value & 0x7f;
	data->system.parm2 = (event->data.control.value >> 7) & 0x7f;