Re: [PATCH] ALSA: pcm: Fix potential device leak on partial registration failure

From: Takashi Iwai

Date: Wed Nov 18 2026 - 07:52:38 EST


On Tue, 17 Nov 2026 15:47:05 +0100,
Guangshuo Li wrote:
>
> If capture registration fails after playback was registered, the PCM
> remains in the BUILD state. Card teardown therefore skips its disconnect
> callback, leaving the playback device registered and holding its parent
> card reference.
>
> Unregister previously registered streams and release their timers before
> returning the registration error.
>
> This issue was found by our static analysis tool under development.
>
> Fixes: ef46c7af93f9 ("ALSA: pcm: Embed struct device")
> Signed-off-by: Guangshuo Li <liguangshuo@xxxxxxxxxxxxxxx>

Applied to for-next branch. Thanks.


Takashi