Skip to contentSkip to conversation

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

PATCH New Takashi Iwai 1 participant 1 message Feb 20, 2024 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 0b5288f5fe63 ("ALSA: ump: Add legacy raw MIDI support")
---
 sound/core/ump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
sound/core/ump.c +2 -2
index 3bef1944e955..fe7911498cc4 100644
@@ -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)
Signature · 1 line
2.35.3