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

Commit 133c2681 authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown
Browse files

ASoC: samsung-i2s: Check secondary DAI exists before referencing



In a couple of places the driver is missing a check to ensure there is a
secondary DAI before it de-references the pointer to it, causing a null
pointer de-reference. This patch adds a check to avoid this.

Signed-off-by: default avatarCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
Acked-by: default avatarSylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
parent 7d1311b9
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -462,7 +462,7 @@ static int i2s_set_sysclk(struct snd_soc_dai *dai,
		if (dir == SND_SOC_CLOCK_IN)
			rfs = 0;

		if ((rfs && other->rfs && (other->rfs != rfs)) ||
		if ((rfs && other && other->rfs && (other->rfs != rfs)) ||
				(any_active(i2s) &&
				(((dir == SND_SOC_CLOCK_IN)
					&& !(mod & MOD_CDCLKCON)) ||
@@ -762,6 +762,7 @@ static void i2s_shutdown(struct snd_pcm_substream *substream,
	} else {
		u32 mod = readl(i2s->addr + I2SMOD);
		i2s->cdclk_out = !(mod & MOD_CDCLKCON);
		if (other)
			other->cdclk_out = i2s->cdclk_out;
	}
	/* Reset any constraint on RFS and BFS */