Re: [PATCH] ALSA: seq: Restore created port information after insertion
From: Takashi Iwai
Date: Tue Jun 02 2026 - 14:03:47 EST
On Tue, 02 Jun 2026 12:55:46 +0200,
Cássio Gabriel wrote:
>
> Commit 2ee646353cd5 ("ALSA: seq: Register kernel port with full
> information") split sequencer port creation from list insertion so a
> port can be filled before it becomes visible.
>
> However, snd_seq_ioctl_create_port() still copies port->addr back to the
> ioctl argument before snd_seq_insert_port() assigns the final port
> number. A successful SNDRV_SEQ_IOCTL_CREATE_PORT without
> SNDRV_SEQ_PORT_FLG_GIVEN_PORT can therefore report port -1 to userspace.
>
> Move the ioctl address copy after successful insertion, and keep the
> default "port-%d" name assignment from overwriting a caller-provided port
> name. This restores the observable behavior from before the split while
> keeping the port populated before publication.
>
> Fixes: 2ee646353cd5 ("ALSA: seq: Register kernel port with full information")
> Signed-off-by: Cássio Gabriel <cassiogabrielcontato@xxxxxxxxx>
Thanks, applied now to for-next branch.
Takashi