ASoC: topology: Fix bugs of freeing soc topology
authorYan Wang <yan.wang@linux.intel.com>
Mon, 26 Mar 2018 15:48:00 +0000 (16:48 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 17 Apr 2018 11:27:24 +0000 (12:27 +0100)
In snd_soc_tplg_component_remove(), it should compare index and
not dobj->index with SND_SOC_TPLG_INDEX_ALL for removing all
topology objects.

Signed-off-by: Yan Wang <yan.wang@linux.intel.com>
Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c

index 942c6e5eb4b7d9d0dd9b9976a57e54acc84101e5..5598e891b2b32c59552d51db650f6eca0e35f86b 100644 (file)
@@ -2580,7 +2580,7 @@ int snd_soc_tplg_component_remove(struct snd_soc_component *comp, u32 index)
 
                        /* match index */
                        if (dobj->index != index &&
-                               dobj->index != SND_SOC_TPLG_INDEX_ALL)
+                               index != SND_SOC_TPLG_INDEX_ALL)
                                continue;
 
                        switch (dobj->type) {