Commit 298402a3 authored by Takashi Iwai's avatar Takashi Iwai Committed by Mark Brown

ASoC: dapm: Return -ENOMEM in snd_soc_dapm_new_dai_widgets()

... instead of NULL dereferences.

Spotted by coverity CID 402004.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent ff18620c
...@@ -3495,6 +3495,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, ...@@ -3495,6 +3495,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
if (!w) { if (!w) {
dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
dai->driver->playback.stream_name); dai->driver->playback.stream_name);
return -ENOMEM;
} }
w->priv = dai; w->priv = dai;
...@@ -3513,6 +3514,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, ...@@ -3513,6 +3514,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
if (!w) { if (!w) {
dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
dai->driver->capture.stream_name); dai->driver->capture.stream_name);
return -ENOMEM;
} }
w->priv = dai; w->priv = dai;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment