diff options
author | Mark Brown <broonie@kernel.org> | 2019-12-10 14:27:14 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-12-10 14:27:14 +0100 |
commit | 2acf6ce2c25fb71a56ad35fcb9a63c19b20a4f4e (patch) | |
tree | c1df2943269ea35c97d07eb392008d38430835b4 /sound/soc/soc-topology.c | |
parent | ASoC: SOF: Intel: byt: fixup topology filename for BYT-CR (diff) | |
parent | ASoC: Intel: common: work-around incorrect ACPI HID for CML boards (diff) | |
download | linux-2acf6ce2c25fb71a56ad35fcb9a63c19b20a4f4e.tar.xz linux-2acf6ce2c25fb71a56ad35fcb9a63c19b20a4f4e.zip |
Merge branch 'for-5.5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-5.6
Diffstat (limited to 'sound/soc/soc-topology.c')
-rw-r--r-- | sound/soc/soc-topology.c | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index e9b660f3116f..f8bd406c6198 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -1935,11 +1935,13 @@ 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->cpus->dai_name); - kfree(link); - return ret; + goto err; + } + + ret = snd_soc_add_pcm_runtime(tplg->comp->card, link); + if (ret < 0) { + dev_err(tplg->comp->dev, "ASoC: adding FE link failed\n"); + goto err; } link->dobj.index = tplg->index; @@ -1947,8 +1949,13 @@ static int soc_tplg_fe_link_create(struct soc_tplg *tplg, link->dobj.type = SND_SOC_DOBJ_DAI_LINK; list_add(&link->dobj.list, &tplg->comp->dobj_list); - snd_soc_add_pcm_runtime(tplg->comp->card, link); return 0; +err: + kfree(link->name); + kfree(link->stream_name); + kfree(link->cpus->dai_name); + kfree(link); + return ret; } /* create a FE DAI and DAI link from the PCM object */ @@ -2041,6 +2048,7 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg, int size; int i; bool abi_match; + int ret; count = le32_to_cpu(hdr->count); @@ -2082,7 +2090,12 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg, } /* create the FE DAIs and DAI links */ - soc_tplg_pcm_create(tplg, _pcm); + ret = soc_tplg_pcm_create(tplg, _pcm); + if (ret < 0) { + if (!abi_match) + kfree(_pcm); + return ret; + } /* offset by version-specific struct size and * real priv data size |