[PATCH 2/4] ASoC: mediatek: Don't keep a freed topology name in the static card

Mark Brown broonie at kernel.org
Thu Oct 8 01:20:56 PDT 2026


On Sat, Oct 03, 2026 at 09:44:59PM +0200, Michał Kopeć wrote:
> 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.

...

> Save the original name before setting the topology name, and restore it
> from a devm action that runs before the string is freed.

This is valid, but it doesn't feel like this is Mediatek specific - we
should probably move this into the core code.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mediatek/attachments/20261008/f7405424/attachment.sig>


More information about the Linux-mediatek mailing list