Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e8bb036a46ec4a9d748672f54a6b2d62c82b6fbd
Commit:     e8bb036a46ec4a9d748672f54a6b2d62c82b6fbd
Parent:     d5f6a38d9896614e2e78a82c6cb818721601c52f
Author:     James C Georgas <[EMAIL PROTECTED]>
AuthorDate: Thu Dec 7 08:10:57 2006 +0100
Committer:  Jaroslav Kysela <[EMAIL PROTECTED]>
CommitDate: Wed Dec 20 08:56:10 2006 +0100

    [ALSA] ac97_codec - trivial fix for bit update functions
    
    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 <[EMAIL PROTECTED]>
    Signed-off-by: Jaroslav Kysela <[EMAIL PROTECTED]>
---
 sound/pci/ac97/ac97_codec.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/sound/pci/ac97/ac97_codec.c b/sound/pci/ac97/ac97_codec.c
index 7abcb10..91d8ceb 100644
--- a/sound/pci/ac97/ac97_codec.c
+++ b/sound/pci/ac97/ac97_codec.c
@@ -382,7 +382,7 @@ int snd_ac97_update_bits_nolock(struct snd_ac97 *ac97, 
unsigned short reg,
        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;
@@ -399,7 +399,7 @@ static int snd_ac97_ad18xx_update_pcm_bits(struct snd_ac97 
*ac97, int codec, uns
 
        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);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to