aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-07-27 08:01:24 -0400
committerTakashi Iwai <tiwai@suse.de>2011-07-27 10:05:30 -0400
commit60a6a8425a84fa46a3831ce79197640b8224311b (patch)
tree7bc9c871f7af52c7fc0683690aeafaf35dacd0c2 /sound
parent767cd365b22820df07b962b49ce04b220b98e537 (diff)
ALSA: hda - Fix Oops with Realtek quirks with NULL adc_nids
Somce quirk models don't set adc_nids but let the parser filling it. But the recent code has unnecessary NULL-checks of spec->input_mux, and it resulted in NULL dereferences. This patch fixes that regression. Reported-and-tested-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/patch_realtek.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
index 694327ae8b71..0383dd8a11df 100644
--- a/sound/pci/hda/patch_realtek.c
+++ b/sound/pci/hda/patch_realtek.c
@@ -1911,7 +1911,7 @@ static int alc_build_controls(struct hda_codec *codec)
1911 return err; 1911 return err;
1912 } 1912 }
1913 } 1913 }
1914 if (spec->cap_mixer) { 1914 if (spec->cap_mixer && spec->adc_nids) {
1915 const char *kname = kctl ? kctl->id.name : NULL; 1915 const char *kname = kctl ? kctl->id.name : NULL;
1916 for (knew = spec->cap_mixer; knew->name; knew++) { 1916 for (knew = spec->cap_mixer; knew->name; knew++) {
1917 if (kname && strcmp(knew->name, kname) == 0) 1917 if (kname && strcmp(knew->name, kname) == 0)
@@ -3677,7 +3677,7 @@ static int patch_alc880(struct hda_codec *codec)
3677 if (board_config != ALC_MODEL_AUTO) 3677 if (board_config != ALC_MODEL_AUTO)
3678 setup_preset(codec, &alc880_presets[board_config]); 3678 setup_preset(codec, &alc880_presets[board_config]);
3679 3679
3680 if (!spec->no_analog && !spec->adc_nids && spec->input_mux) { 3680 if (!spec->no_analog && !spec->adc_nids) {
3681 alc_auto_fill_adc_caps(codec); 3681 alc_auto_fill_adc_caps(codec);
3682 alc_rebuild_imux_for_auto_mic(codec); 3682 alc_rebuild_imux_for_auto_mic(codec);
3683 alc_remove_invalid_adc_nids(codec); 3683 alc_remove_invalid_adc_nids(codec);
@@ -3804,7 +3804,7 @@ static int patch_alc260(struct hda_codec *codec)
3804 if (board_config != ALC_MODEL_AUTO) 3804 if (board_config != ALC_MODEL_AUTO)
3805 setup_preset(codec, &alc260_presets[board_config]); 3805 setup_preset(codec, &alc260_presets[board_config]);
3806 3806
3807 if (!spec->no_analog && !spec->adc_nids && spec->input_mux) { 3807 if (!spec->no_analog && !spec->adc_nids) {
3808 alc_auto_fill_adc_caps(codec); 3808 alc_auto_fill_adc_caps(codec);
3809 alc_rebuild_imux_for_auto_mic(codec); 3809 alc_rebuild_imux_for_auto_mic(codec);
3810 alc_remove_invalid_adc_nids(codec); 3810 alc_remove_invalid_adc_nids(codec);
@@ -3983,7 +3983,7 @@ static int patch_alc882(struct hda_codec *codec)
3983 if (board_config != ALC_MODEL_AUTO) 3983 if (board_config != ALC_MODEL_AUTO)
3984 setup_preset(codec, &alc882_presets[board_config]); 3984 setup_preset(codec, &alc882_presets[board_config]);
3985 3985
3986 if (!spec->no_analog && !spec->adc_nids && spec->input_mux) { 3986 if (!spec->no_analog && !spec->adc_nids) {
3987 alc_auto_fill_adc_caps(codec); 3987 alc_auto_fill_adc_caps(codec);
3988 alc_rebuild_imux_for_auto_mic(codec); 3988 alc_rebuild_imux_for_auto_mic(codec);
3989 alc_remove_invalid_adc_nids(codec); 3989 alc_remove_invalid_adc_nids(codec);
@@ -4137,7 +4137,7 @@ static int patch_alc262(struct hda_codec *codec)
4137 if (board_config != ALC_MODEL_AUTO) 4137 if (board_config != ALC_MODEL_AUTO)
4138 setup_preset(codec, &alc262_presets[board_config]); 4138 setup_preset(codec, &alc262_presets[board_config]);
4139 4139
4140 if (!spec->no_analog && !spec->adc_nids && spec->input_mux) { 4140 if (!spec->no_analog && !spec->adc_nids) {
4141 alc_auto_fill_adc_caps(codec); 4141 alc_auto_fill_adc_caps(codec);
4142 alc_rebuild_imux_for_auto_mic(codec); 4142 alc_rebuild_imux_for_auto_mic(codec);
4143 alc_remove_invalid_adc_nids(codec); 4143 alc_remove_invalid_adc_nids(codec);
@@ -4293,7 +4293,7 @@ static int patch_alc268(struct hda_codec *codec)
4293 (0 << AC_AMPCAP_MUTE_SHIFT)); 4293 (0 << AC_AMPCAP_MUTE_SHIFT));
4294 } 4294 }
4295 4295
4296 if (!spec->no_analog && !spec->adc_nids && spec->input_mux) { 4296 if (!spec->no_analog && !spec->adc_nids) {
4297 alc_auto_fill_adc_caps(codec); 4297 alc_auto_fill_adc_caps(codec);
4298 alc_rebuild_imux_for_auto_mic(codec); 4298 alc_rebuild_imux_for_auto_mic(codec);
4299 alc_remove_invalid_adc_nids(codec); 4299 alc_remove_invalid_adc_nids(codec);
@@ -4705,7 +4705,7 @@ static int patch_alc269(struct hda_codec *codec)
4705 if (board_config != ALC_MODEL_AUTO) 4705 if (board_config != ALC_MODEL_AUTO)
4706 setup_preset(codec, &alc269_presets[board_config]); 4706 setup_preset(codec, &alc269_presets[board_config]);
4707 4707
4708 if (!spec->no_analog && !spec->adc_nids && spec->input_mux) { 4708 if (!spec->no_analog && !spec->adc_nids) {
4709 alc_auto_fill_adc_caps(codec); 4709 alc_auto_fill_adc_caps(codec);
4710 alc_rebuild_imux_for_auto_mic(codec); 4710 alc_rebuild_imux_for_auto_mic(codec);
4711 alc_remove_invalid_adc_nids(codec); 4711 alc_remove_invalid_adc_nids(codec);
@@ -4843,7 +4843,7 @@ static int patch_alc861(struct hda_codec *codec)
4843 if (board_config != ALC_MODEL_AUTO) 4843 if (board_config != ALC_MODEL_AUTO)
4844 setup_preset(codec, &alc861_presets[board_config]); 4844 setup_preset(codec, &alc861_presets[board_config]);
4845 4845
4846 if (!spec->no_analog && !spec->adc_nids && spec->input_mux) { 4846 if (!spec->no_analog && !spec->adc_nids) {
4847 alc_auto_fill_adc_caps(codec); 4847 alc_auto_fill_adc_caps(codec);
4848 alc_rebuild_imux_for_auto_mic(codec); 4848 alc_rebuild_imux_for_auto_mic(codec);
4849 alc_remove_invalid_adc_nids(codec); 4849 alc_remove_invalid_adc_nids(codec);
@@ -4984,7 +4984,7 @@ static int patch_alc861vd(struct hda_codec *codec)
4984 add_verb(spec, alc660vd_eapd_verbs); 4984 add_verb(spec, alc660vd_eapd_verbs);
4985 } 4985 }
4986 4986
4987 if (!spec->no_analog && !spec->adc_nids && spec->input_mux) { 4987 if (!spec->no_analog && !spec->adc_nids) {
4988 alc_auto_fill_adc_caps(codec); 4988 alc_auto_fill_adc_caps(codec);
4989 alc_rebuild_imux_for_auto_mic(codec); 4989 alc_rebuild_imux_for_auto_mic(codec);
4990 alc_remove_invalid_adc_nids(codec); 4990 alc_remove_invalid_adc_nids(codec);
@@ -5200,7 +5200,7 @@ static int patch_alc662(struct hda_codec *codec)
5200 if (board_config != ALC_MODEL_AUTO) 5200 if (board_config != ALC_MODEL_AUTO)
5201 setup_preset(codec, &alc662_presets[board_config]); 5201 setup_preset(codec, &alc662_presets[board_config]);
5202 5202
5203 if (!spec->no_analog && !spec->adc_nids && spec->input_mux) { 5203 if (!spec->no_analog && !spec->adc_nids) {
5204 alc_auto_fill_adc_caps(codec); 5204 alc_auto_fill_adc_caps(codec);
5205 alc_rebuild_imux_for_auto_mic(codec); 5205 alc_rebuild_imux_for_auto_mic(codec);
5206 alc_remove_invalid_adc_nids(codec); 5206 alc_remove_invalid_adc_nids(codec);
@@ -5336,7 +5336,7 @@ static int patch_alc680(struct hda_codec *codec)
5336#endif 5336#endif
5337 } 5337 }
5338 5338
5339 if (!spec->no_analog && !spec->adc_nids && spec->input_mux) { 5339 if (!spec->no_analog && !spec->adc_nids) {
5340 alc_auto_fill_adc_caps(codec); 5340 alc_auto_fill_adc_caps(codec);
5341 alc_rebuild_imux_for_auto_mic(codec); 5341 alc_rebuild_imux_for_auto_mic(codec);
5342 alc_remove_invalid_adc_nids(codec); 5342 alc_remove_invalid_adc_nids(codec);