Skip to content

Commit

Permalink
ALSA: hda - Fix invalid snd_BUG_ON() in alc271_hp_gate_mic_jack()
Browse files Browse the repository at this point in the history
The fixup function is called multiple times before parsing the pins,
so snd_BUG_ON() hits when loaded.  Move it to the proper place in the
if block.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Jan 23, 2013
1 parent 2cf215b commit 0db7579
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions sound/pci/hda/patch_realtek.c
Original file line number Diff line number Diff line change
Expand Up @@ -2729,12 +2729,13 @@ static void alc271_hp_gate_mic_jack(struct hda_codec *codec,
{
struct alc_spec *spec = codec->spec;

if (snd_BUG_ON(!spec->gen.am_entry[1].pin ||
!spec->gen.autocfg.hp_pins[0]))
return;
if (action == HDA_FIXUP_ACT_PROBE)
if (action == HDA_FIXUP_ACT_PROBE) {
if (snd_BUG_ON(!spec->gen.am_entry[1].pin ||
!spec->gen.autocfg.hp_pins[0]))
return;
snd_hda_jack_set_gating_jack(codec, spec->gen.am_entry[1].pin,
spec->gen.autocfg.hp_pins[0]);
}
}

enum {
Expand Down

0 comments on commit 0db7579

Please sign in to comment.