diff options
author | Bard liao <yung-chuan.liao@linux.intel.com> | 2019-03-05 16:57:52 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-03-19 12:50:06 +0100 |
commit | 7b6f68a4df4df3a58e854d24da991640bd4d9590 (patch) | |
tree | 9dec1b7c79761626a89d55a6cf3985a565727839 /sound | |
parent | Merge branch 'for-5.1' of https://git.kernel.org/pub/scm/linux/kernel/git/bro... (diff) | |
download | linux-7b6f68a4df4df3a58e854d24da991640bd4d9590.tar.xz linux-7b6f68a4df4df3a58e854d24da991640bd4d9590.zip |
ASoC: topology: free stream_name of dai_drv
The stream_name is allocated by kstrdup. We have to free it when the
dai is removed or return from error.
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>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/soc-topology.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index fbee4720b834..1be60cea2bf5 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -535,6 +535,8 @@ static void remove_dai(struct snd_soc_component *comp, if (dai->driver == dai_drv) dai->driver = NULL; + kfree(dai_drv->playback.stream_name); + kfree(dai_drv->capture.stream_name); kfree(dai_drv->name); list_del(&dobj->list); kfree(dai_drv); @@ -1808,6 +1810,9 @@ static int soc_tplg_dai_create(struct soc_tplg *tplg, ret = soc_tplg_dai_load(tplg, dai_drv, pcm, NULL); if (ret < 0) { dev_err(tplg->comp->dev, "ASoC: DAI loading failed\n"); + kfree(dai_drv->playback.stream_name); + kfree(dai_drv->capture.stream_name); + kfree(dai_drv->name); kfree(dai_drv); return ret; } |