aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2013-10-29 11:45:34 -0400
committerTakashi Iwai <tiwai@suse.de>2013-10-29 11:46:36 -0400
commit4c88b7f287e329698727049641ecdf50c8c66af5 (patch)
tree8696b2eaad97a938039a19e601b5c59c5cebed79
parente12483e0f3dbc32dad8fa1dc97efac22b6aee94f (diff)
ALSA: ice1724: Fix uninitialized variable access
Spotted by coverity CIDs 751505 and 751506. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/ice1712/wm8766.c3
-rw-r--r--sound/pci/ice1712/wm8776.c3
2 files changed, 4 insertions, 2 deletions
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,
253 } 253 }
254 if (wm->ctl[n].flags & WM8766_FLAG_INVERT) { 254 if (wm->ctl[n].flags & WM8766_FLAG_INVERT) {
255 val1 = wm->ctl[n].max - (val1 - wm->ctl[n].min); 255 val1 = wm->ctl[n].max - (val1 - wm->ctl[n].min);
256 val2 = wm->ctl[n].max - (val2 - wm->ctl[n].min); 256 if (wm->ctl[n].flags & WM8766_FLAG_STEREO)
257 val2 = wm->ctl[n].max - (val2 - wm->ctl[n].min);
257 } 258 }
258 ucontrol->value.integer.value[0] = val1; 259 ucontrol->value.integer.value[0] = val1;
259 if (wm->ctl[n].flags & WM8766_FLAG_STEREO) 260 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,
526 } 526 }
527 if (wm->ctl[n].flags & WM8776_FLAG_INVERT) { 527 if (wm->ctl[n].flags & WM8776_FLAG_INVERT) {
528 val1 = wm->ctl[n].max - (val1 - wm->ctl[n].min); 528 val1 = wm->ctl[n].max - (val1 - wm->ctl[n].min);
529 val2 = wm->ctl[n].max - (val2 - wm->ctl[n].min); 529 if (wm->ctl[n].flags & WM8776_FLAG_STEREO)
530 val2 = wm->ctl[n].max - (val2 - wm->ctl[n].min);
530 } 531 }
531 ucontrol->value.integer.value[0] = val1; 532 ucontrol->value.integer.value[0] = val1;
532 if (wm->ctl[n].flags & WM8776_FLAG_STEREO) 533 if (wm->ctl[n].flags & WM8776_FLAG_STEREO)