From: Kuninori Morimoto Date: Tue, 20 Aug 2019 05:05:32 +0000 (+0900) Subject: ASoC: soc-topology: use for_each_component_dais() at remove_dai() X-Git-Tag: v5.15~5160^2~21^2~117 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=43ca5dab978294eae26a36f8989b6f0769da4256;p=platform%2Fkernel%2Flinux-starfive.git ASoC: soc-topology: use for_each_component_dais() at remove_dai() commit 52abe6cc1866a ("ASoC: topology: fix oops/use-after-free case with dai driver") fixups remove_dai() error, but it is using list_for_each_entry() for component->dai_list. We already have for_each_component_dais() macro for it. Let's use exising method. Signed-off-by: Kuninori Morimoto Link: https://lore.kernel.org/r/87tvaczazd.wl-kuninori.morimoto.gx@renesas.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index dc463f1..b869071 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -530,7 +530,7 @@ static void remove_dai(struct snd_soc_component *comp, if (dobj->ops && dobj->ops->dai_unload) dobj->ops->dai_unload(comp, dobj); - list_for_each_entry(dai, &comp->dai_list, list) + for_each_component_dais(comp, dai) if (dai->driver == dai_drv) dai->driver = NULL;