'w' should not be dereferenced when it is NULL.
Cc: Liam Girdwood lrg@ti.com Cc: Mark Brown broonie@opensource.wolfsonmicro.com Signed-off-by: Sachin Kamat sachin.kamat@linaro.org --- Build tested and based on linux-next 20121115. --- sound/soc/soc-dapm.c | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 6e35bca..5bde5d4 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c @@ -3326,9 +3326,9 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, if (!w) { dev_err(dapm->dev, "Failed to create %s widget\n", dai->driver->playback.stream_name); + } else { + w->priv = dai; } - - w->priv = dai; dai->playback_widget = w; }
@@ -3344,9 +3344,9 @@ int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, if (!w) { dev_err(dapm->dev, "Failed to create %s widget\n", dai->driver->capture.stream_name); + } else { + w->priv = dai; } - - w->priv = dai; dai->capture_widget = w; }