Re: [PATCH 5.10 070/491] ASoC: core: Exit all links before removing their components

Sasha Levin
2026-04-15T00:55:51Z

On Wed, 15 Apr 2026 00:15:56 +0200, Ben Hutchings wrote:
> snd_soc_remove_pcm_runtime() is called from remove_link() in
> soc-topology.c. I might be misunderstanding it, but it seems to free
> the structure that snd_soc_link_exit() accesses immediately after
> snd_soc_remove_pcm_runtime() returns.

I looked into this: In soc_cleanup_card_resources() the link_exit loop
runs before soc_remove_link_components(), so by the time remove_link()
does kfree(link) the exit callback has already completed. All teardown
paths go through soc_cleanup_card_resources() so the ordering seems to
make sense.