Skip to content

Commit

Permalink
ASoC: dapm: Return -ENOMEM in snd_soc_dapm_new_dai_widgets()
Browse files Browse the repository at this point in the history
... instead of NULL dereferences.

Spotted by coverity CID 402004.

Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
tiwai authored and broonie committed Oct 28, 2013
1 parent ff18620 commit 298402a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions sound/soc/soc-dapm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 298402a

Please sign in to comment.