Skip to content

Commit c47914c

Browse files
committed
ALSA: ice1724: Fix invalid access for enumerated ctl items
The access to Analog Capture Source control value implemented in prodigy_hifi.c is wrong, as caught by the recently introduced sanity check; it should be accessing value.enumerated.item[] instead of value.integer.value[]. This patch corrects the wrong access pattern. Fixes: 6b8d6e5 ("[ALSA] ICE1724: Added support for Audiotrak Prodigy 7.1 HiFi & HD2, Hercules Fortissimo IV") BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=207139 Reviewed-by: Jaroslav Kysela <[email protected]> Cc: <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Iwai <[email protected]>
1 parent 0ad3f0b commit c47914c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

sound/pci/ice1712/prodigy_hifi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ static int wm_adc_mux_enum_get(struct snd_kcontrol *kcontrol,
536536
struct snd_ice1712 *ice = snd_kcontrol_chip(kcontrol);
537537

538538
mutex_lock(&ice->gpio_mutex);
539-
ucontrol->value.integer.value[0] = wm_get(ice, WM_ADC_MUX) & 0x1f;
539+
ucontrol->value.enumerated.item[0] = wm_get(ice, WM_ADC_MUX) & 0x1f;
540540
mutex_unlock(&ice->gpio_mutex);
541541
return 0;
542542
}
@@ -550,7 +550,7 @@ static int wm_adc_mux_enum_put(struct snd_kcontrol *kcontrol,
550550

551551
mutex_lock(&ice->gpio_mutex);
552552
oval = wm_get(ice, WM_ADC_MUX);
553-
nval = (oval & 0xe0) | ucontrol->value.integer.value[0];
553+
nval = (oval & 0xe0) | ucontrol->value.enumerated.item[0];
554554
if (nval != oval) {
555555
wm_put(ice, WM_ADC_MUX, nval);
556556
change = 1;

0 commit comments

Comments
 (0)