提交 fbe618f2 编写于 作者: T Takashi Iwai

ALSA: hda - Don't check capture source mixer if no ADC is available

With multiple codec configurations, some codec might have no ADC, thus
it keeps spec->adc_nids = NULL.  This causes an Oops in alc_build_controls().

Reference: kernel bug #16156
	https://bugzilla.kernel.org/show_bug.cgi?id=16156

Cc: <stable@kernel.org>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 ab669967
...@@ -2619,16 +2619,18 @@ static int alc_build_controls(struct hda_codec *codec) ...@@ -2619,16 +2619,18 @@ static int alc_build_controls(struct hda_codec *codec)
} }
/* assign Capture Source enums to NID */ /* assign Capture Source enums to NID */
kctl = snd_hda_find_mixer_ctl(codec, "Capture Source"); if (spec->capsrc_nids || spec->adc_nids) {
if (!kctl) kctl = snd_hda_find_mixer_ctl(codec, "Capture Source");
kctl = snd_hda_find_mixer_ctl(codec, "Input Source"); if (!kctl)
for (i = 0; kctl && i < kctl->count; i++) { kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
hda_nid_t *nids = spec->capsrc_nids; for (i = 0; kctl && i < kctl->count; i++) {
if (!nids) hda_nid_t *nids = spec->capsrc_nids;
nids = spec->adc_nids; if (!nids)
err = snd_hda_add_nid(codec, kctl, i, nids[i]); nids = spec->adc_nids;
if (err < 0) err = snd_hda_add_nid(codec, kctl, i, nids[i]);
return err; if (err < 0)
return err;
}
} }
if (spec->cap_mixer) { if (spec->cap_mixer) {
const char *kname = kctl ? kctl->id.name : NULL; const char *kname = kctl ? kctl->id.name : NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册