[PATCH 4.14 024/189] ASoC: topology: Fix bugs of freeing soc topology

From: Greg Kroah-Hartman
Date: Mon Jun 18 2018 - 04:31:20 EST


4.14-stable review patch. If anyone has any objections, please let me know.

------------------

From: Yan Wang <yan.wang@xxxxxxxxxxxxxxx>

[ Upstream commit feb12f0cd8d7b1e8df2e6fce19fc9a026a468cc2 ]

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@xxxxxxxxxxxxxxx>
Signed-off-by: Liam Girdwood <liam.r.girdwood@xxxxxxxxxxxxxxx>
Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
Signed-off-by: Sasha Levin <alexander.levin@xxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
sound/soc/soc-topology.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -2571,7 +2571,7 @@ int snd_soc_tplg_component_remove(struct

/* match index */
if (dobj->index != index &&
- dobj->index != SND_SOC_TPLG_INDEX_ALL)
+ index != SND_SOC_TPLG_INDEX_ALL)
continue;

switch (dobj->type) {