From: Jeeja KP Date: Thu, 5 May 2016 05:49:18 +0000 (+0530) Subject: ASoC: topology: Fix memory leak in widget creation X-Git-Tag: MMI-PSA29.97-13-9~7791^2^2~11^2 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8ea416748bb04b7a778cb8d2fd5ec7fa51b9d521;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Vinod Koul Signed-off-by: Mark Brown --- 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;