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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Linux Kernel Mailing List
Date: Thursday, March 26, 2009 - 12:17 pm

Gitweb:     http://git.kernel.org/linus/c2503cd3be9eacb1dd06ec5b6fba8bb06aac12a8
Commit:     c2503cd3be9eacb1dd06ec5b6fba8bb06aac12a8
Parent:     f9ffc5d6f0161b66202f2df9ecc42d1be241020d
Author:     Takashi Iwai <tiwai@suse.de>
AuthorDate: Thu Mar 5 09:37:40 2009 +0100
Committer:  Takashi Iwai <tiwai@suse.de>
CommitDate: Thu Mar 5 09:37:40 2009 +0100

    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: Takashi Iwai <tiwai@suse.de>
---
 sound/pci/rme9652/hdsp.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c
index dc65fe1..314e735 100644
--- a/sound/pci/rme9652/hdsp.c
+++ b/sound/pci/rme9652/hdsp.c
@@ -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);
--
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
ALSA: hdsp - Ignore MIDI and PCM events in interrupts unti ..., Linux Kernel Mailing ..., (Thu Mar 26, 12:17 pm)