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

From: Mark Brown

Date: Thu Oct 08 2026 - 04:21:06 EST


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.

Attachment: signature.asc
Description: PGP signature