ALSA: ice1724: Fix uninitialized variable access
authorTakashi Iwai <tiwai@suse.de>
Tue, 29 Oct 2013 15:45:34 +0000 (16:45 +0100)
committerTakashi Iwai <tiwai@suse.de>
Tue, 29 Oct 2013 15:46:36 +0000 (16:46 +0100)
Spotted by coverity CIDs 751505 and 751506.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/pci/ice1712/wm8766.c
sound/pci/ice1712/wm8776.c

index e473f8a88f9c8e95db609ee4d677c689ffb141f4..21b373b2e2600e7f91f7ee680512502f79a96479 100644 (file)
@@ -253,7 +253,8 @@ static int snd_wm8766_ctl_get(struct snd_kcontrol *kcontrol,
        }
        if (wm->ctl[n].flags & WM8766_FLAG_INVERT) {
                val1 = wm->ctl[n].max - (val1 - wm->ctl[n].min);
-               val2 = wm->ctl[n].max - (val2 - wm->ctl[n].min);
+               if (wm->ctl[n].flags & WM8766_FLAG_STEREO)
+                       val2 = wm->ctl[n].max - (val2 - wm->ctl[n].min);
        }
        ucontrol->value.integer.value[0] = val1;
        if (wm->ctl[n].flags & WM8766_FLAG_STEREO)
index 5227cb08247f7e97dd47c3c19144b49b4f11820d..e66c0da62014bfd75453770a2fdc8ddec106e827 100644 (file)
@@ -526,7 +526,8 @@ static int snd_wm8776_ctl_get(struct snd_kcontrol *kcontrol,
        }
        if (wm->ctl[n].flags & WM8776_FLAG_INVERT) {
                val1 = wm->ctl[n].max - (val1 - wm->ctl[n].min);
-               val2 = wm->ctl[n].max - (val2 - wm->ctl[n].min);
+               if (wm->ctl[n].flags & WM8776_FLAG_STEREO)
+                       val2 = wm->ctl[n].max - (val2 - wm->ctl[n].min);
        }
        ucontrol->value.integer.value[0] = val1;
        if (wm->ctl[n].flags & WM8776_FLAG_STEREO)