Commit 4a230769 authored by Ranjani Sridharan's avatar Ranjani Sridharan Committed by Mark Brown

ASoC: SOF: topology: return error if sof_connect_dai_widget() fails

Return the error if sof_connect_dai_widget() fails to
abort topology loading and prevent card registration.
Reviewed-by: default avatarGuennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: default avatarRanjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211004212729.199550-4-pierre-louis.bossart@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent ea6bfbbe
......@@ -2379,13 +2379,14 @@ static int sof_widget_ready(struct snd_soc_component *scomp, int index,
}
ret = sof_widget_load_dai(scomp, index, swidget, tw, dai);
if (ret == 0) {
sof_connect_dai_widget(scomp, w, tw, dai);
list_add(&dai->list, &sdev->dai_list);
swidget->private = dai;
} else {
if (!ret)
ret = sof_connect_dai_widget(scomp, w, tw, dai);
if (ret < 0) {
kfree(dai);
break;
}
list_add(&dai->list, &sdev->dai_list);
swidget->private = dai;
break;
case snd_soc_dapm_mixer:
ret = sof_widget_load_mixer(scomp, index, swidget, tw);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment