summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorLiam Girdwood <lrg@ti.com>2012-01-16 16:23:31 +0100
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-01-16 16:49:09 +0100
commite7c80e2a8b403c10d805f48596efac741cce754d (patch)
treedf84341aaf1fe912449a9f85ff8a731b34225360 /sound/soc
parentASoC: sgtl5000: update author email address (diff)
downloadlinux-e7c80e2a8b403c10d805f48596efac741cce754d.tar.xz
linux-e7c80e2a8b403c10d805f48596efac741cce754d.zip
ASoC: dapm - Fix check for codec context in dapm_power_widgets().
Fixes a NULL pointer dereference in dapm_power_widgets() if the dapm context has no codec. Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/soc-dapm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 3ad1f59b8028..1f55ded4047f 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -1426,7 +1426,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
dapm->target_bias_level = SND_SOC_BIAS_ON;
break;
case SND_SOC_DAPM_STREAM_STOP:
- if (dapm->codec->active)
+ if (dapm->codec && dapm->codec->active)
dapm->target_bias_level = SND_SOC_BIAS_ON;
else
dapm->target_bias_level = SND_SOC_BIAS_STANDBY;