Commit 34db6a3e authored by Amadeusz Sławiński's avatar Amadeusz Sławiński Committed by Mark Brown

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: default avatarAmadeusz Sławiński <amadeuszx.slawinski@intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent a46e8393
...@@ -410,6 +410,7 @@ static void remove_enum(struct snd_soc_component *comp, ...@@ -410,6 +410,7 @@ static void remove_enum(struct snd_soc_component *comp,
kfree(dobj->control.dvalues); kfree(dobj->control.dvalues);
for (i = 0; i < se->items; i++) for (i = 0; i < se->items; i++)
kfree(dobj->control.dtexts[i]); kfree(dobj->control.dtexts[i]);
kfree(dobj->control.dtexts);
kfree(se); kfree(se);
} }
...@@ -467,6 +468,7 @@ static void remove_widget(struct snd_soc_component *comp, ...@@ -467,6 +468,7 @@ static void remove_widget(struct snd_soc_component *comp,
kfree(dobj->control.dvalues); kfree(dobj->control.dvalues);
for (j = 0; j < se->items; j++) for (j = 0; j < se->items; j++)
kfree(dobj->control.dtexts[j]); kfree(dobj->control.dtexts[j]);
kfree(dobj->control.dtexts);
kfree(se); kfree(se);
kfree(w->kcontrol_news[i].name); kfree(w->kcontrol_news[i].name);
...@@ -1361,6 +1363,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create( ...@@ -1361,6 +1363,7 @@ static struct snd_kcontrol_new *soc_tplg_dapm_widget_denum_create(
kfree(se->dobj.control.dvalues); kfree(se->dobj.control.dvalues);
for (j = 0; j < ec->items; j++) for (j = 0; j < ec->items; j++)
kfree(se->dobj.control.dtexts[j]); kfree(se->dobj.control.dtexts[j]);
kfree(se->dobj.control.dtexts);
kfree(se); kfree(se);
kfree(kc[i].name); kfree(kc[i].name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment