ASoC: topology: Check return value of soc_tplg_dai_config

[ Upstream commit dd8e871d4e ]

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>
This commit is contained in:
Amadeusz Sławiński 2020-03-27 16:47:29 -04:00 committed by Greg Kroah-Hartman
parent fd8f4a3be5
commit a5dec15686
1 changed files with 7 additions and 2 deletions

View File

@ -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));
}