At probing time, the elements that aren't assigned to kctl or jack may
be called. Need proper NULL-checks.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
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);
}
unsigned int present;
int type;
- if (!jack)
+ if (!jack || !jack->jack)
return;
present = snd_hda_jack_detect(codec, nid);