Commit 49cbb7b7 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: ump: Fix the discard error code from snd_ump_legacy_open()

snd_ump_legacy_open() didn't return the error code properly even if it
couldn't open.  Fix it.

Fixes: 0b5288f5 ("ALSA: ump: Add legacy raw MIDI support")
Cc: <stable@vger.kernel.org>
Link: https://lore.kernel.org/r/20240220150843.28630-1-tiwai@suse.deSigned-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 1fdf4e8b
...@@ -985,7 +985,7 @@ static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream) ...@@ -985,7 +985,7 @@ static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream)
struct snd_ump_endpoint *ump = substream->rmidi->private_data; struct snd_ump_endpoint *ump = substream->rmidi->private_data;
int dir = substream->stream; int dir = substream->stream;
int group = ump->legacy_mapping[substream->number]; int group = ump->legacy_mapping[substream->number];
int err; int err = 0;
mutex_lock(&ump->open_mutex); mutex_lock(&ump->open_mutex);
if (ump->legacy_substreams[dir][group]) { if (ump->legacy_substreams[dir][group]) {
...@@ -1009,7 +1009,7 @@ static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream) ...@@ -1009,7 +1009,7 @@ static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream)
spin_unlock_irq(&ump->legacy_locks[dir]); spin_unlock_irq(&ump->legacy_locks[dir]);
unlock: unlock:
mutex_unlock(&ump->open_mutex); mutex_unlock(&ump->open_mutex);
return 0; return err;
} }
static int snd_ump_legacy_close(struct snd_rawmidi_substream *substream) static int snd_ump_legacy_close(struct snd_rawmidi_substream *substream)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment