summaryrefslogtreecommitdiff
path: root/sound/core
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2024-11-29 10:45:42 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-01-09 13:31:50 +0100
commitcf29cbf61cf2d914d4877b5e09c47cb19e744e3d (patch)
treecdd11b963ebf5fbcdfca03201b6d7e7f3fe3abb3 /sound/core
parentb5e175e18a39c3190134dd3174d532a59c766a23 (diff)
downloadlinux-cf29cbf61cf2d914d4877b5e09c47cb19e744e3d.tar.gz
linux-cf29cbf61cf2d914d4877b5e09c47cb19e744e3d.tar.bz2
linux-cf29cbf61cf2d914d4877b5e09c47cb19e744e3d.zip
ALSA: ump: Don't open legacy substream for an inactive group
[ Upstream commit 3978d53df7236f0a517c2abeb43ddf6ac162cdd8 ] When a UMP Group is inactive, we shouldn't allow users to access it via the legacy MIDI access. Add the group active flag check and return -ENODEV if it's inactive. Link: https://patch.msgid.link/20241129094546.32119-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'sound/core')
-rw-r--r--sound/core/ump.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/core/ump.c b/sound/core/ump.c
index ada2625ce78f..5a4a7d0b7cca 100644
--- a/sound/core/ump.c
+++ b/sound/core/ump.c
@@ -1081,6 +1081,8 @@ static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream)
guard(mutex)(&ump->open_mutex);
if (ump->legacy_substreams[dir][group])
return -EBUSY;
+ if (!ump->groups[group].active)
+ return -ENODEV;
if (dir == SNDRV_RAWMIDI_STREAM_OUTPUT) {
if (!ump->legacy_out_opens) {
err = snd_rawmidi_kernel_open(&ump->core, 0,