Re: [PATCH] ALSA: ac97: fix a double free in snd_ac97_controller_register()
From: Takashi Iwai
Date: Tue Dec 23 2025 - 04:44:25 EST
On Fri, 19 Dec 2025 17:28:45 +0100,
Haoxiang Li wrote:
>
> If ac97_add_adapter() fails, put_device() is the correct way to drop
> the device reference. kfree() is not required.
> Add kfree() if idr_alloc() fails and in ac97_adapter_release() to do
> the cleanup.
>
> Found by code review.
>
> Fixes: 74426fbff66e ("ALSA: ac97: add an ac97 bus")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Haoxiang Li <lihaoxiang@xxxxxxxxxxxxxxxx>
Thanks, applied now.
Takashi