This patch fixes a couple of bit update functions in
alsa-kernel/pci/ac97/ac97_codec.c, which could possibly corrupt bits not
in the given mask.
Specifically, it'll clobber unset bits in the target that are not in the
mask, when the corresponding bit in the given new value is set.
Signed-off-by: James C Georgas <jgeorgas@rogers.com>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
unsigned short old, new;
old = snd_ac97_read_cache(ac97, reg);
- new = (old & ~mask) | value;
+ new = (old & ~mask) | (value & mask);
change = old != new;
if (change) {
ac97->regs[reg] = new;
mutex_lock(&ac97->page_mutex);
old = ac97->spec.ad18xx.pcmreg[codec];
- new = (old & ~mask) | value;
+ new = (old & ~mask) | (value & mask);
change = old != new;
if (change) {
mutex_lock(&ac97->reg_mutex);