summaryrefslogtreecommitdiff
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-12-17 15:01:31 +0100
committerTakashi Iwai <tiwai@suse.de>2009-12-17 15:01:31 +0100
commitd1409ae4cecb4af260759bdfdf88fafca23a9940 (patch)
tree514a86b37a4511e79fdee8dc071c68020943619e /sound/pci/hda
parent9e671deb8547638f6504c5f20126b14f5563690d (diff)
downloadlinux-3.10-d1409ae4cecb4af260759bdfdf88fafca23a9940.tar.gz
linux-3.10-d1409ae4cecb4af260759bdfdf88fafca23a9940.tar.bz2
linux-3.10-d1409ae4cecb4af260759bdfdf88fafca23a9940.zip
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/hda')
-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 36556b10357..012435212e5 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)
if (!kctl)
kctl = snd_hda_find_mixer_ctl(codec, "Input Source");
for (i = 0; kctl && i < kctl->count; i++) {
- err = snd_hda_add_nids(codec, kctl, i, spec->capsrc_nids,
+ hda_nid_t *nids = spec->capsrc_nids;
+ if (!nids)
+ nids = spec->adc_nids;
+ err = snd_hda_add_nids(codec, kctl, i, nids,
spec->input_mux->num_items);
if (err < 0)
return err;