Re: [PATCH v2] ALSA: ice1712: Fix the card leak at probe error with the auto-cleanup
From: Takashi Iwai
Date: Thu Aug 20 2026 - 04:55:46 EST
On Thu, 20 Aug 2026 03:41:17 +0200,
Haotian Zhang wrote:
>
> snd_ice1712_probe() performs multiple initialization steps after
> snd_card_new(), but directly returns on failures from later steps
> without releasing the ALSA card, causing resource leaks when
> probing fails.
>
> Use snd_devm_card_new() together with scope-based cleanup
> via __free(snd_card_unref), and clear the card pointer after
> successful registration to keep it alive.
>
> Fixes: ca642da4b33d ("ALSA: ice1712: Allocate resources with device-managed APIs")
> Suggested-by: Takashi Iwai <tiwai@xxxxxxx>
> Signed-off-by: Haotian Zhang <vulab@xxxxxxxxxxx>
Applied now. Thanks.
Takashi