diff options
author | Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> | 2020-03-27 21:47:29 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-04-09 13:46:08 +0200 |
commit | dd8e871d4e560eeb8d22af82dde91457ad835a63 (patch) | |
tree | b5aaa4a8ae25e7e821b64ba9fcdfeedd9dd8e195 /sound/soc/soc-topology.c | |
parent | ASoC: topology: Check return value of pcm_new_ver (diff) | |
download | linux-dd8e871d4e560eeb8d22af82dde91457ad835a63.tar.xz linux-dd8e871d4e560eeb8d22af82dde91457ad835a63.zip |
ASoC: topology: Check return value of soc_tplg_dai_config
Function soc_tplg_dai_config can fail, check for and handle possible
failure.
Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com>
Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20200327204729.397-7-amadeuszx.slawinski@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/soc-topology.c')
-rw-r--r-- | sound/soc/soc-topology.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c index 818657b06799..33e8d189ba2f 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2524,7 +2524,7 @@ static int soc_tplg_dai_elems_load(struct soc_tplg *tplg, { struct snd_soc_tplg_dai *dai; int count; - int i; + int i, ret; count = le32_to_cpu(hdr->count); @@ -2539,7 +2539,12 @@ static int soc_tplg_dai_elems_load(struct soc_tplg *tplg, return -EINVAL; } - soc_tplg_dai_config(tplg, dai); + ret = soc_tplg_dai_config(tplg, dai); + if (ret < 0) { + dev_err(tplg->dev, "ASoC: failed to configure DAI\n"); + return ret; + } + tplg->pos += (sizeof(*dai) + le32_to_cpu(dai->priv.size)); } |