Re: [PATCH v2] ALSA: ice1712: Fix the card leak at probe error with the auto-cleanup

Takashi Iwai <[email protected]>
Newsgroups org.kernel.vger.linux-sound,org.kernel.vger.linux-kernel
Message-ID <[email protected]>
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 <[email protected]>
> Signed-off-by: Haotian Zhang <[email protected]>

Applied now.  Thanks.


Takashi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.