提交 6ed9495e 编写于 作者: J Jie Yang 提交者: Takashi Iwai

ALSA: jack: don't report input event for phantom jack

There is no input_dev for phantom jack, we should not report
input event for it, otherwise, NULL pointer dereference error
will occur.

Fixes: 2ba2dfa1 ('ALSA: hda - Update to use the new jack kctls method')
Signed-off-by: NJie Yang <yang.jie@intel.com>
Signed-off-by: NTakashi Iwai <tiwai@suse.de>
上级 12e180a2
...@@ -339,6 +339,13 @@ void snd_jack_report(struct snd_jack *jack, int status) ...@@ -339,6 +339,13 @@ void snd_jack_report(struct snd_jack *jack, int status)
if (!jack) if (!jack)
return; return;
list_for_each_entry(jack_kctl, &jack->kctl_list, list)
snd_kctl_jack_report(jack->card, jack_kctl->kctl,
status & jack_kctl->mask_bits);
if (!jack->input_dev)
return;
for (i = 0; i < ARRAY_SIZE(jack->key); i++) { for (i = 0; i < ARRAY_SIZE(jack->key); i++) {
int testbit = SND_JACK_BTN_0 >> i; int testbit = SND_JACK_BTN_0 >> i;
...@@ -357,10 +364,6 @@ void snd_jack_report(struct snd_jack *jack, int status) ...@@ -357,10 +364,6 @@ void snd_jack_report(struct snd_jack *jack, int status)
input_sync(jack->input_dev); input_sync(jack->input_dev);
list_for_each_entry(jack_kctl, &jack->kctl_list, list)
snd_kctl_jack_report(jack->card, jack_kctl->kctl,
status & jack_kctl->mask_bits);
} }
EXPORT_SYMBOL(snd_jack_report); EXPORT_SYMBOL(snd_jack_report);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册