Merge remote-tracking branch 'asoc/fix/dapm' into asoc-linus
authorMark Brown <broonie@kernel.org>
Sun, 19 Feb 2017 16:35:33 +0000 (16:35 +0000)
committerMark Brown <broonie@kernel.org>
Sun, 19 Feb 2017 16:35:33 +0000 (16:35 +0000)
1  2 
sound/soc/soc-topology.c

diff --combined sound/soc/soc-topology.c
index fbfb1fab88d5be60de7c40ed8fa1dd78d6fae727,37006c63891aac0be3b56179f715bfef178aa56a..01e8bb0910b205dbc3cd494c2e4567100ec79397
@@@ -514,12 -514,13 +514,12 @@@ static void remove_widget(struct snd_so
                            == SND_SOC_TPLG_TYPE_MIXER)
                                kfree(kcontrol->tlv.p);
  
 -                      snd_ctl_remove(card, kcontrol);
 -
                        /* Private value is used as struct soc_mixer_control
                         * for volume mixers or soc_bytes_ext for bytes
                         * controls.
                         */
                        kfree((void *)kcontrol->private_value);
 +                      snd_ctl_remove(card, kcontrol);
                }
                kfree(w->kcontrol_news);
        }
@@@ -1555,6 -1556,15 +1555,15 @@@ widget
                widget = snd_soc_dapm_new_control(dapm, &template);
        else
                widget = snd_soc_dapm_new_control_unlocked(dapm, &template);
+       if (IS_ERR(widget)) {
+               ret = PTR_ERR(widget);
+               /* Do not nag about probe deferrals */
+               if (ret != -EPROBE_DEFER)
+                       dev_err(tplg->dev,
+                               "ASoC: failed to create widget %s controls (%d)\n",
+                               w->name, ret);
+               goto hdr_err;
+       }
        if (widget == NULL) {
                dev_err(tplg->dev, "ASoC: failed to create widget %s controls\n",
                        w->name);