On Sat, 28 Nov 2026 09:52:35 +0100,
Sreeraj S Kurup wrote:
>
> Fix aoa_codec_unregister() to use the codec's own fabric pointer
> when removing a codec.
>
> Previously, the function checked the global fabric pointer instead
> of codec->fabric. This could call the fabric's remove_codec()
> callback for a codec that was never attached to the fabric.
>
> The function also called module_put() unconditionally, even when
> attach_codec_to_fabric() had not acquired a module reference.
> This could cause an incorrect module reference count.
>
> Use aoa_fabric_unlink_codec() to detach an attached codec. This
> helper calls exit(), remove_codec(), and module_put() and clears
> codec->fabric. These operations are now performed only when the
> codec is actually attached to a fabric.
>
> This also prevents releasing the module reference a second time
> when codec initialization fails and the attach path has already
> cleaned up.
>
> Fixes: f3d9478b2ce4 ("[ALSA] snd-aoa: add snd-aoa")
> Signed-off-by: Sreeraj S Kurup <[email protected]>
Applied to for-next branch. Thanks.
Takashi