summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeeja KP <jeeja.kp@intel.com>2016-05-05 11:19:18 +0530
committerMark Brown <broonie@kernel.org>2016-05-05 16:46:29 +0100
commit8ea416748bb04b7a778cb8d2fd5ec7fa51b9d521 (patch)
tree89cacbd61c60a70285bdbc72ce26aa7ed825e261
parent06eb49f72fa57f5a49acdf9f4af84d2d326513b3 (diff)
downloadtalos-obmc-linux-8ea416748bb04b7a778cb8d2fd5ec7fa51b9d521.tar.gz
talos-obmc-linux-8ea416748bb04b7a778cb8d2fd5ec7fa51b9d521.zip
ASoC: topology: Fix memory leak in widget creation
name and sname allocated in widget create are not freed when creation is successful, so free them. Signed-off-by: Jeeja KP <jeeja.kp@intel.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/soc-topology.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 29ae3d3a0f8a..ee7f15aa46fc 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1481,6 +1481,8 @@ widget:
widget->dobj.type = SND_SOC_DOBJ_WIDGET;
widget->dobj.ops = tplg->ops;
widget->dobj.index = tplg->index;
+ kfree(template.sname);
+ kfree(template.name);
list_add(&widget->dobj.list, &tplg->comp->dobj_list);
return 0;
OpenPOWER on IntegriCloud