diff options
author | Amadeusz Sławiński <amadeuszx.slawinski@linux.intel.com> | 2020-03-27 16:47:29 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2020-05-10 10:31:23 +0200 |
commit | a5dec15686e9af32693024fb8fdc2125fd41ad8d (patch) | |
tree | a1b747f18e5c8b593fc4ed6afee92958a5eae01d /sound/soc/soc-topology.c | |
parent | fd8f4a3be50b54d6a9d66d7dfbdb4cd444ff415e (diff) |
ASoC: topology: Check return value of soc_tplg_dai_config
[ Upstream commit dd8e871d4e560eeb8d22af82dde91457ad835a63 ]
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>
Signed-off-by: Sasha Levin <sashal@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 22960f5932c7..2d4a5a3058c4 100644 --- a/sound/soc/soc-topology.c +++ b/sound/soc/soc-topology.c @@ -2431,7 +2431,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); @@ -2446,7 +2446,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)); } |