[alsa-devel] [bug report] ASoC: dapm: Implement and instantiate DAI widgets

Dan Carpenter dan.carpenter at oracle.com
Thu Jan 19 08:38:26 CET 2017


Hello Mark Brown,

The patch 888df395ebc5: "ASoC: dapm: Implement and instantiate DAI
widgets" from Feb 16, 2012, leads to the following static checker
warning:

	sound/soc/soc-dapm.c:3944 snd_soc_dapm_new_dai_widgets()
	error: 'w' dereferencing possible ERR_PTR()

sound/soc/soc-dapm.c
  3929          if (dai->driver->playback.stream_name) {
  3930                  template.id = snd_soc_dapm_dai_in;
  3931                  template.name = dai->driver->playback.stream_name;
  3932                  template.sname = dai->driver->playback.stream_name;
  3933  
  3934                  dev_dbg(dai->dev, "ASoC: adding %s widget\n",
  3935                          template.name);
  3936  
  3937                  w = snd_soc_dapm_new_control_unlocked(dapm, &template);

This can either return NULL or ERR_PTR(-EPROBE_DEFER).

  3938                  if (!w) {
  3939                          dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
  3940                                  dai->driver->playback.stream_name);
  3941                          return -ENOMEM;
  3942                  }
  3943  
  3944                  w->priv = dai;
                        ^^^^^^^^^^^^^

  3945                  dai->playback_widget = w;
  3946          }

regards,
dan carpenter


More information about the Alsa-devel mailing list