From: Nariman Poushin Date: Mon, 31 Mar 2014 14:47:12 +0000 (+0100) Subject: ASoC: core: Fail probe if we fail to add dai widgets X-Git-Tag: firefly_0821_release~176^2~3750^2~24^2~13^2~17 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=261edc7013a7435e40fd5ebb3682eac6fc3c15ea;p=firefly-linux-kernel-4.4.55.git ASoC: core: Fail probe if we fail to add dai widgets Signed-off-by: Nariman Poushin Signed-off-by: Mark Brown --- diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index 051c006281f5..d5710fc79b49 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c @@ -1132,8 +1132,15 @@ static int soc_probe_codec(struct snd_soc_card *card, driver->num_dapm_widgets); /* Create DAPM widgets for each DAI stream */ - list_for_each_entry(dai, &codec->component.dai_list, list) - snd_soc_dapm_new_dai_widgets(&codec->dapm, dai); + list_for_each_entry(dai, &codec->component.dai_list, list) { + ret = snd_soc_dapm_new_dai_widgets(&codec->dapm, dai); + + if (ret != 0) { + dev_err(codec->dev, + "Failed to create DAI widgets %d\n", ret); + goto err_probe; + } + } codec->dapm.idle_bias_off = driver->idle_bias_off;