From c9c7552fed046c4d9838cafa59fbf23079ebb199 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Mon, 4 Aug 2025 11:01:06 +0200 Subject: [PATCH] alsa: clear port before adding to free list If we clear the port after adding, we will destroy the links into the list and cause crashes later. --- spa/plugins/alsa/alsa-seq-bridge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spa/plugins/alsa/alsa-seq-bridge.c b/spa/plugins/alsa/alsa-seq-bridge.c index 15baf0a7f..06c5bc28f 100644 --- a/spa/plugins/alsa/alsa-seq-bridge.c +++ b/spa/plugins/alsa/alsa-seq-bridge.c @@ -389,11 +389,11 @@ static void free_port(struct seq_state *state, struct seq_stream *stream, struct { stream->ports[port->id] = NULL; spa_list_remove(&port->link); - spa_list_append(&state->free_list, &port->link); spa_node_emit_port_info(&state->hooks, port->direction, port->id, NULL); spa_zero(*port); + spa_list_append(&state->free_list, &port->link); } static void init_port(struct seq_state *state, struct seq_port *port, const snd_seq_addr_t *addr,