Re: [PATCH] ALSA: pcmcia: Fix resource leak in snd_pdacf_probe error path

From: Takashi Iwai

Date: Mon Dec 15 2025 - 04:11:54 EST


On Mon, 15 Dec 2025 10:04:33 +0100,
Haotian Zhang wrote:
>
> When pdacf_config() fails, snd_pdacf_probe() returns the error code
> directly without freeing the sound card resources allocated by
> snd_card_new(), which leads to a memory leak.
>
> Add proper error handling to free the sound card and clear the card
> list entry when pdacf_config() fails.
>
> Fixes: 15b99ac17295 ("[PATCH] pcmcia: add return value to _config() functions")
> Suggested-by: Takashi Iwai <tiwai@xxxxxxx>
> Signed-off-by: Haotian Zhang <vulab@xxxxxxxxxxx>

Applied now. Thanks.


Takashi