Commit c2503cd3 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hdsp - Ignore MIDI and PCM events in interrupts until initialized

Ignore MIDI and PCM events in the interrupt handler until the device
gets initialized properly.  Otherwise you may get kernel panic by the
access to uninitialized devices via hotplugging.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent f9ffc5d6
...@@ -3740,6 +3740,9 @@ static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id) ...@@ -3740,6 +3740,9 @@ static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id)
midi0status = hdsp_read (hdsp, HDSP_midiStatusIn0) & 0xff; midi0status = hdsp_read (hdsp, HDSP_midiStatusIn0) & 0xff;
midi1status = hdsp_read (hdsp, HDSP_midiStatusIn1) & 0xff; midi1status = hdsp_read (hdsp, HDSP_midiStatusIn1) & 0xff;
if (!(hdsp->state & HDSP_InitializationComplete))
return IRQ_HANDLED;
if (audio) { if (audio) {
if (hdsp->capture_substream) if (hdsp->capture_substream)
snd_pcm_period_elapsed(hdsp->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream); snd_pcm_period_elapsed(hdsp->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream);
......
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