diff options
author | Ranjani Sridharan | 2021-10-04 16:27:29 -0500 |
---|---|---|
committer | Mark Brown | 2021-10-05 13:09:56 +0100 |
commit | 4a23076987476337085ae04b923bc39deec34643 (patch) | |
tree | 1355ac35229d2c072854602392aebd2f2682f920 | |
parent | ea6bfbbe3ea83861bab034538e36becb16eef20b (diff) |
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: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com>
Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20211004212729.199550-4-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/sof/topology.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/sound/soc/sof/topology.c b/sound/soc/sof/topology.c index b54b3d280297..534f004f6162 100644 --- a/sound/soc/sof/topology.c +++ b/sound/soc/sof/topology.c @@ -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); |