From: Takashi Iwai Date: Tue, 29 Oct 2013 15:45:34 +0000 (+0100) Subject: ALSA: ice1724: Fix uninitialized variable access X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4c88b7f287e329698727049641ecdf50c8c66af5;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git ALSA: ice1724: Fix uninitialized variable access Spotted by coverity CIDs 751505 and 751506. Signed-off-by: Takashi Iwai --- diff --git a/sound/pci/ice1712/wm8766.c b/sound/pci/ice1712/wm8766.c index e473f8a88f9c..21b373b2e260 100644 --- a/sound/pci/ice1712/wm8766.c +++ b/sound/pci/ice1712/wm8766.c @@ -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) diff --git a/sound/pci/ice1712/wm8776.c b/sound/pci/ice1712/wm8776.c index 5227cb08247f..e66c0da62014 100644 --- a/sound/pci/ice1712/wm8776.c +++ b/sound/pci/ice1712/wm8776.c @@ -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)