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.
This commit is contained in:
Wim Taymans 2025-08-04 11:01:06 +02:00
parent 02aee17cc3
commit c9c7552fed

View file

@ -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,