diff options
| author | Michał Kopeć <michal@nozomi.space> | 2026-10-03 21:44:59 +0200 |
|---|---|---|
| committer | Mark Brown <broonie@kernel.org> | 2026-10-08 10:15:42 +0200 |
| commit | 50c5d7f3a9b4d2a2baca40657e46a3508cdac2d1 (patch) | |
| tree | a77764d2b2d6729a8ba7622762c086c1dca2fad4 /scripts/Makefile.thinlto | |
| parent | 6cb1f09e1f699d0c7f748057bc50d84a1e9e77fc (diff) | |
| download | linux-50c5d7f3a9b4d2a2baca40657e46a3508cdac2d1.tar.gz linux-50c5d7f3a9b4d2a2baca40657e46a3508cdac2d1.zip | |
ASoC: mediatek: Don't keep a freed topology name in the static card
The machine drivers pass a static snd_soc_card, which outlives any one
probe. With SOF, mtk_soundcard_common_probe() calls
snd_soc_card_set_topology_name(), which devm-allocates "sof-<name>",
stores it in card->topology_shortname and points card->name at it.
If the probe then fails or defers, devm frees the string, but the static
card keeps both pointers. The next probe does not allocate a new name,
because topology_shortname is already set, so the card registers with
whatever now occupies that memory:
input: \xc0cr\xc2 DP Jack as /devices/platform/sound/sound/card0/input10
UCM matches profiles by card name, so userspace then finds no profile and
the card is unusable until the next boot.
Save the original name before setting the topology name, and restore it
from a devm action that runs before the string is freed.
Fixes: ec4489c43efe ("ASoC: soc-card: add snd_soc_card_set_topology_name()")
Signed-off-by: Michał Kopeć <michal@nozomi.space>
Link: https://patch.msgid.link/20261003194501.832558-3-michal@nozomi.space
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
