Skip to content

Commit 3978d53

Browse files
committed
ALSA: ump: Don't open legacy substream for an inactive group
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/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent aaa55fa commit 3978d53

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sound/core/ump.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,8 @@ static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream)
10871087
guard(mutex)(&ump->open_mutex);
10881088
if (ump->legacy_substreams[dir][group])
10891089
return -EBUSY;
1090+
if (!ump->groups[group].active)
1091+
return -ENODEV;
10901092
if (dir == SNDRV_RAWMIDI_STREAM_OUTPUT) {
10911093
if (!ump->legacy_out_opens) {
10921094
err = snd_rawmidi_kernel_open(&ump->core, 0,

0 commit comments

Comments
 (0)