Skip to content

Commit

Permalink
ALSA: hda - Fix a wrong array range check in patch_realtek.c
Browse files Browse the repository at this point in the history
The commit 6a4f2cc introduced a wrong
comparision for the array range check, which effectively skips the whole
initialization of DAC connections.  Fixed now.

Reference: bko#15689
	https://bugzilla.kernel.org/show_bug.cgi?id=15689

Reported-by: Adrian Ulrich <kernel@blinkenlights.ch>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Apr 5, 2010
1 parent d128418 commit f9700d5
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -10110,13 +10110,12 @@ static void alc882_auto_set_output_and_unmute(struct hda_codec *codec,
int idx;

alc_set_pin_output(codec, nid, pin_type);
if (dac_idx >= spec->multiout.num_dacs)
return;
if (spec->multiout.dac_nids[dac_idx] == 0x25)
idx = 4;
else {
if (spec->multiout.num_dacs >= dac_idx)
return;
else
idx = spec->multiout.dac_nids[dac_idx] - 2;
}
snd_hda_codec_write(codec, nid, 0, AC_VERB_SET_CONNECT_SEL, idx);

}
Expand Down

0 comments on commit f9700d5

Please sign in to comment.