ASoC: topology: free link string in error
authorBard liao <yung-chuan.liao@linux.intel.com>
Tue, 5 Mar 2019 15:57:53 +0000 (23:57 +0800)
committerMark Brown <broonie@kernel.org>
Tue, 19 Mar 2019 11:56:40 +0000 (11:56 +0000)
Some strings are allocated by kstrdup, but not freed when error
happened.

Signed-off-by: Bard liao <yung-chuan.liao@linux.intel.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c

index 1be60cea2bf541842b2ebc95b116ca888f0b2428..c6a30d000f59fe5458969dcb9fa71e3d963a5103 100644 (file)
@@ -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;
        }