diff mbox series

[2/2] ASoC: topology: free link string in error

Message ID 20190305155753.10362-2-yung-chuan.liao@linux.intel.com (mailing list archive)
State Accepted
Commit b3718b8f7e9b4afdfd281d35233b078585aef2e9
Headers show
Series [1/2] ASoC: topology: free stream_name of dai_drv | expand

Commit Message

Bard Liao March 5, 2019, 3:57 p.m. UTC
Some strings are allocated by kstrdup, but not freed when error
happened.

Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
---
 sound/soc/soc-topology.c | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
index 4e05ef001e04..bb055c001b9c 100644
--- a/sound/soc/soc-topology.c
+++ b/sound/soc/soc-topology.c
@@ -1881,6 +1881,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;
 	}