aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorHarald Welte <HaraldWelte@viatech.com>2008-09-15 10:41:31 -0400
committerJaroslav Kysela <perex@perex.cz>2008-09-23 02:18:11 -0400
commitf8fdd4958b6c7af9abf630f06d43db4ddcd532f6 (patch)
tree7748f32790e119a1c4bd3f2e5210043ee8cc74c5 /sound
parenta6d77317678148c973bb0131cc5a3a772f756d23 (diff)
ALSA: HDA VIA: Fix crash on codecs without Headphone
Don't enumerate via_hp_mixer while hp_mux is null (headphone does not exist), to fix the crash of via_independent_hp_info (via_hp_mixer's .info), which will reference hp_mux. Signed-off-by: Logan Li <LoganLi@viatech.com.cn> Signed-off-by: Harald Welte <HaraldWelte@viatech.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_via.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/sound/pci/hda/patch_via.c b/sound/pci/hda/patch_via.c
index 6e360d39c02e..43fb96538b80 100644
--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -1303,7 +1303,8 @@ static int vt1708_parse_auto_config(struct hda_codec *codec)
1303 1303
1304 spec->input_mux = &spec->private_imux[0]; 1304 spec->input_mux = &spec->private_imux[0];
1305 1305
1306 spec->mixers[spec->num_mixers++] = via_hp_mixer; 1306 if (spec->hp_mux)
1307 spec->mixers[spec->num_mixers++] = via_hp_mixer;
1307 1308
1308 return 1; 1309 return 1;
1309} 1310}
@@ -1773,6 +1774,9 @@ static int vt1709_parse_auto_config(struct hda_codec *codec)
1773 1774
1774 spec->input_mux = &spec->private_imux[0]; 1775 spec->input_mux = &spec->private_imux[0];
1775 1776
1777 if (spec->hp_mux)
1778 spec->mixers[spec->num_mixers++] = via_hp_mixer;
1779
1776 return 1; 1780 return 1;
1777} 1781}
1778 1782
@@ -2314,7 +2318,8 @@ static int vt1708B_parse_auto_config(struct hda_codec *codec)
2314 2318
2315 spec->input_mux = &spec->private_imux[0]; 2319 spec->input_mux = &spec->private_imux[0];
2316 2320
2317 spec->mixers[spec->num_mixers++] = via_hp_mixer; 2321 if (spec->hp_mux)
2322 spec->mixers[spec->num_mixers++] = via_hp_mixer;
2318 2323
2319 return 1; 2324 return 1;
2320} 2325}
@@ -2770,7 +2775,8 @@ static int vt1708S_parse_auto_config(struct hda_codec *codec)
2770 2775
2771 spec->input_mux = &spec->private_imux[0]; 2776 spec->input_mux = &spec->private_imux[0];
2772 2777
2773 spec->mixers[spec->num_mixers++] = via_hp_mixer; 2778 if (spec->hp_mux)
2779 spec->mixers[spec->num_mixers++] = via_hp_mixer;
2774 2780
2775 return 1; 2781 return 1;
2776} 2782}
@@ -3100,7 +3106,8 @@ static int vt1702_parse_auto_config(struct hda_codec *codec)
3100 3106
3101 spec->input_mux = &spec->private_imux[0]; 3107 spec->input_mux = &spec->private_imux[0];
3102 3108
3103 spec->mixers[spec->num_mixers++] = via_hp_mixer; 3109 if (spec->hp_mux)
3110 spec->mixers[spec->num_mixers++] = via_hp_mixer;
3104 3111
3105 return 1; 3112 return 1;
3106} 3113}