]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: topology: Check failure to create a widget
authorMengdong Lin <mengdong.lin@linux.intel.com>
Wed, 27 Apr 2016 06:52:38 +0000 (14:52 +0800)
committerMark Brown <broonie@kernel.org>
Wed, 27 Apr 2016 16:32:30 +0000 (17:32 +0100)
Stop loading topology info if error happens when creating a widget.

Signed-off-by: Mengdong Lin <mengdong.lin@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/soc-topology.c

index ca5f828850311b7afbe6261e332363c5bfcf279c..0224a6458f3bbf5337284da3b7665958421102d8 100644 (file)
@@ -1500,9 +1500,11 @@ static int soc_tplg_dapm_widget_elems_load(struct soc_tplg *tplg,
        for (i = 0; i < count; i++) {
                widget = (struct snd_soc_tplg_dapm_widget *) tplg->pos;
                ret = soc_tplg_dapm_widget_create(tplg, widget);
-               if (ret < 0)
+               if (ret < 0) {
                        dev_err(tplg->dev, "ASoC: failed to load widget %s\n",
                                widget->name);
+                       return ret;
+               }
        }
 
        return 0;