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

Commit 78bf3c9a authored by Mark Brown's avatar Mark Brown
Browse files

ASoC: Enforce the mask in snd_soc_update_bits()



Avoids issues if someone does a read followed by restore and doesn't mask
out only the bits being updated.

Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: default avatarLiam Girdwood <lrg@ti.com>
parent 51b3b5ca
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2323,7 +2323,7 @@ int snd_soc_update_bits(struct snd_soc_codec *codec, unsigned short reg,
		return ret;

	old = ret;
	new = (old & ~mask) | value;
	new = (old & ~mask) | (value & mask);
	change = old != new;
	if (change) {
		ret = snd_soc_write(codec, reg, new);