diff options
| author | Takashi Iwai <tiwai@suse.de> | 2013-10-28 09:21:50 -0400 |
|---|---|---|
| committer | Mark Brown <broonie@linaro.org> | 2013-10-28 12:33:10 -0400 |
| commit | 298402a3858e17e6a78acafa1dcd490167dd9f74 (patch) | |
| tree | 7696f718a538f94df7a70a9409a27a9f02ac5d2e | |
| parent | ff18620c2157671a8ee21ebb8e6a3520ea209b1f (diff) | |
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>
| -rw-r--r-- | sound/soc/soc-dapm.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index e650e995a8e6..b2949aed1ac2 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, | |||
| 3495 | if (!w) { | 3495 | if (!w) { |
| 3496 | dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", | 3496 | dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", |
| 3497 | dai->driver->playback.stream_name); | 3497 | dai->driver->playback.stream_name); |
| 3498 | return -ENOMEM; | ||
| 3498 | } | 3499 | } |
| 3499 | 3500 | ||
| 3500 | w->priv = dai; | 3501 | w->priv = dai; |
| @@ -3513,6 +3514,7 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, | |||
| 3513 | if (!w) { | 3514 | if (!w) { |
| 3514 | dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", | 3515 | dev_err(dapm->dev, "ASoC: Failed to create %s widget\n", |
| 3515 | dai->driver->capture.stream_name); | 3516 | dai->driver->capture.stream_name); |
| 3517 | return -ENOMEM; | ||
| 3516 | } | 3518 | } |
| 3517 | 3519 | ||
| 3518 | w->priv = dai; | 3520 | w->priv = dai; |
