Skip to content

Commit 4ef7cf2

Browse files
committed
Merge branch '5.6/fixes' into 5.6/master
* 5.6/fixes: ALSA: hda: Fix potential access overflow in beep helper
2 parents 521d01c + 991d83f commit 4ef7cf2

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

sound/pci/hda/hda_beep.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,8 +290,12 @@ int snd_hda_mixer_amp_switch_get_beep(struct snd_kcontrol *kcontrol,
290290
{
291291
struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
292292
struct hda_beep *beep = codec->beep;
293+
int chs = get_amp_channels(kcontrol);
294+
293295
if (beep && (!beep->enabled || !ctl_has_mute(kcontrol))) {
294-
ucontrol->value.integer.value[0] =
296+
if (chs & 1)
297+
ucontrol->value.integer.value[0] = beep->enabled;
298+
if (chs & 2)
295299
ucontrol->value.integer.value[1] = beep->enabled;
296300
return 0;
297301
}

0 commit comments

Comments
 (0)