diff mbox series

[v2,25/25] ASoC: soc-topology: use for_each_component_dais() at remove_dai()

Message ID 87pnlh9320.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State New, archived
Headers show
Series ASoC: cleanup patches for soc-core | expand

Commit Message

Kuninori Morimoto Aug. 7, 2019, 1:32 a.m. UTC
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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 <kuninori.morimoto.gx@renesas.com>
---
v1 -> v2

	- no change

 sound/soc/soc-topology.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Sridharan, Ranjani Aug. 7, 2019, 3:20 a.m. UTC | #1
On Tue, Aug 6, 2019 at 6:48 PM Kuninori Morimoto <
kuninori.morimoto.gx@renesas.com> wrote:

> From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
>
> 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.
>
The series looks good now. Thanks for the quick turnaround, Morimoto-san.

Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>

>
> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
> v1 -> v2
>
>         - no change
>
>  sound/soc/soc-topology.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> 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;
>
> --
> 2.7.4
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
diff mbox series

Patch

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;