aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2009-07-08 01:45:46 -0400
committerTakashi Iwai <tiwai@suse.de>2009-07-08 01:45:46 -0400
commit1c55d521f4e58be55735d7ac47e8197d6791fa9a (patch)
treebf730a6ca4f090c78233c00f363b443ec2c9f73e
parent337b9d02b4873ceac91565272545fb6fd446d939 (diff)
ALSA: hda - Check widget types while parsing capture source in patch_via.c
Check the widget type and don't take invalid widgets while parsing the capture source in patch_via.c. Also, fixed some compile warnings introduced in the previous commit. Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r--sound/pci/hda/patch_via.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 38db45964228..9008b4b013aa 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -392,7 +392,6 @@ static int via_mux_enum_put(struct snd_kcontrol *kcontrol,
392 struct hda_codec *codec = snd_kcontrol_chip(kcontrol); 392 struct hda_codec *codec = snd_kcontrol_chip(kcontrol);
393 struct via_spec *spec = codec->spec; 393 struct via_spec *spec = codec->spec;
394 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id); 394 unsigned int adc_idx = snd_ctl_get_ioffidx(kcontrol, &ucontrol->id);
395 unsigned int vendor_id = codec->vendor_id;
396 395
397 if (!spec->mux_nids[adc_idx]) 396 if (!spec->mux_nids[adc_idx])
398 return -EINVAL; 397 return -EINVAL;
@@ -1340,6 +1339,10 @@ static int get_mux_nids(struct hda_codec *codec)
1340 for (i = 0; i < spec->num_adc_nids; i++) { 1339 for (i = 0; i < spec->num_adc_nids; i++) {
1341 nid = spec->adc_nids[i]; 1340 nid = spec->adc_nids[i];
1342 while (nid) { 1341 while (nid) {
1342 type = (get_wcaps(codec, nid) & AC_WCAP_TYPE)
1343 >> AC_WCAP_TYPE_SHIFT;
1344 if (type == AC_WID_PIN)
1345 break;
1343 n = snd_hda_get_connections(codec, nid, conn, 1346 n = snd_hda_get_connections(codec, nid, conn,
1344 ARRAY_SIZE(conn)); 1347 ARRAY_SIZE(conn));
1345 if (n <= 0) 1348 if (n <= 0)
@@ -1351,6 +1354,7 @@ static int get_mux_nids(struct hda_codec *codec)
1351 nid = conn[0]; 1354 nid = conn[0];
1352 } 1355 }
1353 } 1356 }
1357 return 0;
1354} 1358}
1355 1359
1356static int patch_vt1708(struct hda_codec *codec) 1360static int patch_vt1708(struct hda_codec *codec)