Skip to content

Commit

Permalink
ALSA: hdsp - Ignore MIDI and PCM events in interrupts until initialized
Browse files Browse the repository at this point in the history
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: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
Takashi Iwai committed Mar 5, 2009
1 parent f9ffc5d commit c2503cd
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions sound/pci/rme9652/hdsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -3740,6 +3740,9 @@ static irqreturn_t snd_hdsp_interrupt(int irq, void *dev_id)
midi0status = hdsp_read (hdsp, HDSP_midiStatusIn0) & 0xff;
midi1status = hdsp_read (hdsp, HDSP_midiStatusIn1) & 0xff;

if (!(hdsp->state & HDSP_InitializationComplete))
return IRQ_HANDLED;

if (audio) {
if (hdsp->capture_substream)
snd_pcm_period_elapsed(hdsp->pcm->streams[SNDRV_PCM_STREAM_CAPTURE].substream);
Expand Down

0 comments on commit c2503cd

Please sign in to comment.