Skip to content

Commit

Permalink
ALSA: ump: Fix the discard error code from snd_ump_legacy_open()
Browse files Browse the repository at this point in the history
commit 49cbb7b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
tiwai authored and gregkh committed Mar 6, 2024
1 parent 1b9c7b7 commit b22393c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/core/ump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand All @@ -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)
Expand Down

0 comments on commit b22393c

Please sign in to comment.