summaryrefslogtreecommitdiffstats
path: root/sound/pci/hda
diff options
context:
space:
mode:
authorHarald Welte <HaraldWelte@viatech.com>2008-09-15 22:41:31 +0800
committerJaroslav Kysela <perex@perex.cz>2008-09-23 08:18:11 +0200
commitf8fdd4958b6c7af9abf630f06d43db4ddcd532f6 (patch)
tree7748f32790e119a1c4bd3f2e5210043ee8cc74c5 /sound/pci/hda
parenta6d77317678148c973bb0131cc5a3a772f756d23 (diff)
downloadop-kernel-dev-f8fdd4958b6c7af9abf630f06d43db4ddcd532f6.zip
op-kernel-dev-f8fdd4958b6c7af9abf630f06d43db4ddcd532f6.tar.gz
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/pci/hda')
-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 6e360d3..43fb965 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)
spec->input_mux = &spec->private_imux[0];
- spec->mixers[spec->num_mixers++] = via_hp_mixer;
+ if (spec->hp_mux)
+ spec->mixers[spec->num_mixers++] = via_hp_mixer;
return 1;
}
@@ -1773,6 +1774,9 @@ static int vt1709_parse_auto_config(struct hda_codec *codec)
spec->input_mux = &spec->private_imux[0];
+ if (spec->hp_mux)
+ spec->mixers[spec->num_mixers++] = via_hp_mixer;
+
return 1;
}
@@ -2314,7 +2318,8 @@ static int vt1708B_parse_auto_config(struct hda_codec *codec)
spec->input_mux = &spec->private_imux[0];
- spec->mixers[spec->num_mixers++] = via_hp_mixer;
+ if (spec->hp_mux)
+ spec->mixers[spec->num_mixers++] = via_hp_mixer;
return 1;
}
@@ -2770,7 +2775,8 @@ static int vt1708S_parse_auto_config(struct hda_codec *codec)
spec->input_mux = &spec->private_imux[0];
- spec->mixers[spec->num_mixers++] = via_hp_mixer;
+ if (spec->hp_mux)
+ spec->mixers[spec->num_mixers++] = via_hp_mixer;
return 1;
}
@@ -3100,7 +3106,8 @@ static int vt1702_parse_auto_config(struct hda_codec *codec)
spec->input_mux = &spec->private_imux[0];
- spec->mixers[spec->num_mixers++] = via_hp_mixer;
+ if (spec->hp_mux)
+ spec->mixers[spec->num_mixers++] = via_hp_mixer;
return 1;
}
OpenPOWER on IntegriCloud