diff mbox series

[2/7] ASoC: topology: Remove widgets from dobj list

Message ID 20190125200648.12470-3-pierre-louis.bossart@linux.intel.com (mailing list archive)
State Accepted
Commit a46e8393d128d4e5f722b47f708a0d5de91e0176
Headers show
Series ASoC: topology: fixes and improvements | expand

Commit Message

Pierre-Louis Bossart Jan. 25, 2019, 8:06 p.m. UTC
From: Amadeusz Sławiński <amadeuszx.slawinski@intel.com>

Currently when we unload and reload machine driver few times we end with
corrupted list and try to cleanup no longer existing objects. Fix this
by removing dobj from the list.

Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
---
 sound/soc/soc-topology.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index b02c41614f96..abc2d804d5bf 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -493,6 +493,8 @@  static void remove_widget(struct snd_soc_component *comp,
 free_news:
 	kfree(w->kcontrol_news);
 
+	list_del(&dobj->list);
+
 	/* widget w is freed by soc-dapm.c */
 }