diff options
author | Takashi Iwai <tiwai@suse.de> | 2024-02-20 18:08:43 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-06 17:48:39 +0300 |
commit | bb06ffbf3862fbe7ba2572db2c249d374c558cc7 (patch) | |
tree | 227f6bd1f3ce5bc652362fa2b4fc24f31a5e67aa | |
parent | 22df6ff560c5621a957fb45489a053d8d861373a (diff) | |
download | linux-bb06ffbf3862fbe7ba2572db2c249d374c558cc7.tar.xz |
ALSA: ump: Fix the discard error code from snd_ump_legacy_open()
commit 49cbb7b7d36ec3ba73ce1daf7ae1d71d435453b8 upstream.
snd_ump_legacy_open() didn't return the error code properly even if it
couldn't open. Fix it.
Fixes: 0b5288f5fe63 ("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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | sound/core/ump.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/core/ump.c b/sound/core/ump.c index 3bef1944e955..fe7911498cc4 100644 --- a/sound/core/ump.c +++ b/sound/core/ump.c @@ -985,7 +985,7 @@ static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream) struct snd_ump_endpoint *ump = substream->rmidi->private_data; int dir = substream->stream; int group = ump->legacy_mapping[substream->number]; - int err; + int err = 0; mutex_lock(&ump->open_mutex); if (ump->legacy_substreams[dir][group]) { @@ -1009,7 +1009,7 @@ static int snd_ump_legacy_open(struct snd_rawmidi_substream *substream) spin_unlock_irq(&ump->legacy_locks[dir]); unlock: mutex_unlock(&ump->open_mutex); - return 0; + return err; } static int snd_ump_legacy_close(struct snd_rawmidi_substream *substream) |