aboutsummaryrefslogtreecommitdiffstats
path: root/sound/pci
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-12-17 09:01:31 -0500
committerTakashi Iwai <tiwai@suse.de>2009-12-17 09:01:31 -0500
commitd1409ae4cecb4af260759bdfdf88fafca23a9940 (patch)
tree514a86b37a4511e79fdee8dc071c68020943619e /sound/pci
parent9e671deb8547638f6504c5f20126b14f5563690d (diff)
ALSA: hda - Fix NULL dereference in kctl-NID mapping in patch_realtek.c
capsrc_nids can be NULL, and adc_nids should be taken as fallback. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci')
-rw-r--r--sound/pci/hda/patch_realtek.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 36556b10357a..012435212e58 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -2517,7 +2517,10 @@ static int alc_build_controls(struct hda_codec *codec)
2517 if (!kctl) 2517 if (!kctl)
2518 kctl = snd_hda_find_mixer_ctl(codec, "Input Source"); 2518 kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
2519 for (i = 0; kctl && i < kctl->count; i++) { 2519 for (i = 0; kctl && i < kctl->count; i++) {
2520 err = snd_hda_add_nids(codec, kctl, i, spec->capsrc_nids, 2520 hda_nid_t *nids = spec->capsrc_nids;
2521 if (!nids)
2522 nids = spec->adc_nids;
2523 err = snd_hda_add_nids(codec, kctl, i, nids,
2521 spec->input_mux->num_items); 2524 spec->input_mux->num_items);
2522 if (err < 0) 2525 if (err < 0)
2523 return err; 2526 return err;