Skip to contentSkip to conversation

ASoC: dapm - Fix check for codec context in dapm_power_widgets().

PATCH Applied Liam Girdwood 2 participants 2 messages Jan 16, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 sound/soc/soc-dapm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/soc-dapm.c +1 -1
index 3ad1f59..1f55ded 100644
@@ -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;
Signature · 1 line
1.7.5.4
Applied
#1 lore raw
Quoted 2 lines · Liam Girdwood

Fixes a NULL pointer dereference in dapm_power_widgets() if the dapm context has no codec.

Applied, thanks.