summaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-topology.c
diff options
context:
space:
mode:
authorAmadeusz Sławiński <amadeuszx.slawinski@intel.com>2019-01-25 14:06:44 -0600
committerMark Brown <broonie@kernel.org>2019-01-29 18:03:23 +0000
commit34db6a3e91d8f6f6fefbbd9ad7e1efc6f8d440e0 (patch)
treebbba82e4957bc4811a430fda0a86ac297d560767 /sound/soc/soc-topology.c
parenta46e8393d128d4e5f722b47f708a0d5de91e0176 (diff)
downloadblackbird-op-linux-34db6a3e91d8f6f6fefbbd9ad7e1efc6f8d440e0.tar.gz
blackbird-op-linux-34db6a3e91d8f6f6fefbbd9ad7e1efc6f8d440e0.zip
ASoC: topology: Fix memory leak from soc_tplg_denum_create_texts
dtexts is two dimensional array, so we also need to free it after freeing its fields. Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-topology.c')
-rw-r--r--sound/soc/soc-topology.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index abc2d804d5bf..71bc5b8a9bd3 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -410,6 +410,7 @@ static void remove_enum(struct snd_soc_component *comp,
kfree(dobj->control.dvalues);
for (i = 0; i < se->items; i++)
kfree(dobj->control.dtexts[i]);
+ kfree(dobj->control.dtexts);
kfree(se);
}
@@ -467,6 +468,7 @@ static void remove_widget(struct snd_soc_component *comp,
kfree(dobj->control.dvalues);
for (j = 0; j < se->items; j++)
kfree(dobj->control.dtexts[j]);
+ kfree(dobj->control.dtexts);
kfree(se);
kfree(w->kcontrol_news[i].name);
@@ -1361,6 +1363,7 @@ err_se:
kfree(se->dobj.control.dvalues);
for (j = 0; j < ec->items; j++)
kfree(se->dobj.control.dtexts[j]);
+ kfree(se->dobj.control.dtexts);
kfree(se);
kfree(kc[i].name);
OpenPOWER on IntegriCloud