Commit cfc7c9d3 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda/jack - Fix NULL-dereference at probing

At probing time, the elements that aren't assigned to kctl or jack may
be called.  Need proper NULL-checks.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent d1cb6200
......@@ -194,6 +194,8 @@ void snd_hda_jack_report_sync(struct hda_codec *codec)
for (i = 0; i < codec->jacktbl.used; i++, jack++)
if (jack->nid) {
jack_detect_update(codec, jack);
if (!jack->kctl)
continue;
state = get_jack_plug_state(jack->pin_sense);
snd_kctl_jack_report(codec->bus->card, jack->kctl, state);
}
......@@ -356,7 +358,7 @@ void snd_hda_input_jack_report(struct hda_codec *codec, hda_nid_t nid)
unsigned int present;
int type;
if (!jack)
if (!jack || !jack->jack)
return;
present = snd_hda_jack_detect(codec, nid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment