Skip to content

Commit

Permalink
ASoC: topology: free link string in error
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bardliao authored and broonie committed Mar 19, 2019
1 parent 7b6f68a commit b3718b8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/soc/soc-topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit b3718b8

Please sign in to comment.