Skip to content

Commit 49cbb7b

Browse files
committed
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: 0b5288f ("ALSA: ump: Add legacy raw MIDI support") Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20240220150843.28630-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
1 parent 1fdf4e8 commit 49cbb7b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sound/core/ump.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream)
985985
struct snd_ump_endpoint *ump = substream->rmidi->private_data;
986986
int dir = substream->stream;
987987
int group = ump->legacy_mapping[substream->number];
988-
int err;
988+
int err = 0;
989989

990990
mutex_lock(&ump->open_mutex);
991991
if (ump->legacy_substreams[dir][group]) {
@@ -1009,7 +1009,7 @@ static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream)
10091009
spin_unlock_irq(&ump->legacy_locks[dir]);
10101010
unlock:
10111011
mutex_unlock(&ump->open_mutex);
1012-
return 0;
1012+
return err;
10131013
}
10141014

10151015
static int snd_ump_legacy_close(struct snd_rawmidi_substream *substream)

0 commit comments

Comments
 (0)