From: Bard liao Date: Tue, 5 Mar 2019 15:57:53 +0000 (+0800) Subject: ASoC: topology: free link string in error X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b3718b8f7e9b4afdfd281d35233b078585aef2e9;p=openwrt%2Fstaging%2Fblogic.git ASoC: topology: free link string in error Some strings are allocated by kstrdup, but not freed when error happened. Signed-off-by: Bard liao Acked-by: Pierre-Louis Bossart Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 1be60cea2bf5..c6a30d000f59 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1883,6 +1883,9 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg, ret = soc_tplg_dai_link_load(tplg, link, NULL); if (ret < 0) { dev_err(tplg->comp->dev, "ASoC: FE link loading failed\n"); + kfree(link->name); + kfree(link->stream_name); + kfree(link->cpu_dai_name); kfree(link); return ret; }