summaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-10-28 14:21:50 +0100
committerMark Brown <broonie@linaro.org>2013-10-28 09:33:10 -0700
commit298402a3858e17e6a78acafa1dcd490167dd9f74 (patch)
tree7696f718a538f94df7a70a9409a27a9f02ac5d2e /sound
parentff18620c2157671a8ee21ebb8e6a3520ea209b1f (diff)
downloadop-kernel-dev-298402a3858e17e6a78acafa1dcd490167dd9f74.zip
op-kernel-dev-298402a3858e17e6a78acafa1dcd490167dd9f74.tar.gz
ASoC: dapm: Return -ENOMEM in snd_soc_dapm_new_dai_widgets()
... instead of NULL dereferences. Spotted by coverity CID 402004. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/soc-dapm.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index e650e99..b2949ae 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -3495,6 +3495,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
if (!w) {
dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
dai->driver->playback.stream_name);
+ return -ENOMEM;
}
w->priv = dai;
@@ -3513,6 +3514,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm,
if (!w) {
dev_err(dapm->dev, "ASoC: Failed to create %s widget\n",
dai->driver->capture.stream_name);
+ return -ENOMEM;
}
w->priv = dai;
OpenPOWER on IntegriCloud