提交 d8d881dd 编写于 作者: T Takashi Iwai

ALSA: hda - Fix NULL dereference with enable_beep=0 option

Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 de8853bc
...@@ -3779,15 +3779,16 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out ...@@ -3779,15 +3779,16 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
err = snd_hda_attach_beep_device(codec, nid); err = snd_hda_attach_beep_device(codec, nid);
if (err < 0) if (err < 0)
return err; return err;
/* IDT/STAC codecs have linear beep tone parameter */ if (codec->beep) {
codec->beep->linear_tone = 1; /* IDT/STAC codecs have linear beep tone parameter */
/* if no beep switch is available, make its own one */ codec->beep->linear_tone = 1;
caps = query_amp_caps(codec, nid, HDA_OUTPUT); /* if no beep switch is available, make its own one */
if (codec->beep && caps = query_amp_caps(codec, nid, HDA_OUTPUT);
!((caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT)) { if (!(caps & AC_AMPCAP_MUTE)) {
err = stac92xx_beep_switch_ctl(codec); err = stac92xx_beep_switch_ctl(codec);
if (err < 0) if (err < 0)
return err; return err;
}
} }
} }
#endif #endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册