ALSA: ump: Don't accept an invalid UMP protocol number
authorTakashi Iwai <tiwai@suse.de>
Wed, 29 May 2024 16:47:16 +0000 (18:47 +0200)
committerTakashi Iwai <tiwai@suse.de>
Wed, 29 May 2024 16:48:51 +0000 (18:48 +0200)
commitac0d71ee534e67c7e53439e8e9cb45ed40731660
treeb0a4e0b5fecfde06c68b56cb0e4ce96b436693f6
parent6d40dbc75877110c5e0d661dd77f6cfce916765e
ALSA: ump: Don't accept an invalid UMP protocol number

When a UMP Stream Configuration message is received, the driver tries
to switch the protocol, but there was no sanity check of the protocol,
hence it can pass an invalid value.  Add the check and bail out if a
wrong value is passed.

Fixes: a79807683781 ("ALSA: ump: Add helper to change MIDI protocol")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20240529164723.18309-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/ump.c