From 9889d1ce0aa3f7d617647d13fd422dd57890e629 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Sun, 19 Jan 2025 15:56:01 +0100 Subject: [PATCH] alsa: close the sequence on error. --- spa/plugins/alsa/alsa-seq.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/spa/plugins/alsa/alsa-seq.c b/spa/plugins/alsa/alsa-seq.c index 995eec3a9..2a4ebd2c4 100644 --- a/spa/plugins/alsa/alsa-seq.c +++ b/spa/plugins/alsa/alsa-seq.c @@ -37,8 +37,12 @@ static int seq_open(struct seq_state *state, struct seq_conn *conn, bool with_qu 0)) < 0) return res; - if ((res = snd_seq_set_client_midi_version(conn->hndl, SND_SEQ_CLIENT_UMP_MIDI_2_0)) < 0) + if ((res = snd_seq_set_client_midi_version(conn->hndl, SND_SEQ_CLIENT_UMP_MIDI_2_0)) < 0) { + snd_seq_close(conn->hndl); + spa_log_info(state->log, "%p: ALSA failed to enable UMP MIDI: %s", + state, snd_strerror(res)); return res; + } return 0; }