mirror of
https://github.com/adulau/aha.git
synced 2024-12-27 19:26:25 +00:00
ALSA: hda - Fix NULL dereference with enable_beep=0 option
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This commit is contained in:
parent
de8853bc38
commit
d8d881dd2c
1 changed files with 10 additions and 9 deletions
|
@ -3779,17 +3779,18 @@ static int stac92xx_parse_auto_config(struct hda_codec *codec, hda_nid_t dig_out
|
|||
err = snd_hda_attach_beep_device(codec, nid);
|
||||
if (err < 0)
|
||||
return err;
|
||||
if (codec->beep) {
|
||||
/* IDT/STAC codecs have linear beep tone parameter */
|
||||
codec->beep->linear_tone = 1;
|
||||
/* if no beep switch is available, make its own one */
|
||||
caps = query_amp_caps(codec, nid, HDA_OUTPUT);
|
||||
if (codec->beep &&
|
||||
!((caps & AC_AMPCAP_MUTE) >> AC_AMPCAP_MUTE_SHIFT)) {
|
||||
if (!(caps & AC_AMPCAP_MUTE)) {
|
||||
err = stac92xx_beep_switch_ctl(codec);
|
||||
if (err < 0)
|
||||
return err;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
err = stac92xx_auto_create_hp_ctls(codec, &spec->autocfg);
|
||||
|
|
Loading…
Reference in a new issue