Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e7c80e2a authored by Liam Girdwood's avatar Liam Girdwood Committed by Mark Brown
Browse files

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: default avatarLiam Girdwood <lrg@ti.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent f7cb8a4b
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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;
			dapm->target_bias_level = SND_SOC_BIAS_ON;
			break;
			break;
		case SND_SOC_DAPM_STREAM_STOP:
		case SND_SOC_DAPM_STREAM_STOP:
			if (dapm->codec->active)
			if (dapm->codec && dapm->codec->active)
				dapm->target_bias_level = SND_SOC_BIAS_ON;
				dapm->target_bias_level = SND_SOC_BIAS_ON;
			else
			else
				dapm->target_bias_level = SND_SOC_BIAS_STANDBY;
				dapm->target_bias_level = SND_SOC_BIAS_STANDBY;