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>
This commit is contained in:
Amadeusz Sławiński 2020-03-27 16:47:29 -04:00 committed by Mark Brown
parent b3677fc3d6
commit dd8e871d4e
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
1 changed files with 7 additions and 2 deletions

View File

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