The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [146/165] ALSA: Echoaudio, fix Guru Meditation #00000005.48454C50
@ 2010-07-30 17:16 Greg KH
  0 siblings, 0 replies; only message in thread
From: Greg KH @ 2010-07-30 17:16 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: stable-review, torvalds, akpm, alan, Giuliano Pochini,
	Takashi Iwai

2.6.32-stable review patch.  If anyone has any objections, please let us know.

------------------

From: Giuliano Pochini <pochini@shiny.it>

commit b721e68bdc5b39c51bf6a1469f8d3663fbe03243 upstream.

This patch fixes a division by zero error in the irq handler.

There is a small window between the hw_params() callback and when
runtime->frame_bits is set by ALSA middle layer. When another substream is
already running, if an interrupt is delivered during that window the irq
handler calls pcm_pointer() which does a division by zero. The patch below
makes the irq handler skip substreams that are initialized but not started
yet. Cc to Clemens Ladisch because he proposed an alternate fix.

For more information, please read the original thread in the linux-kernel
mailing list: http://lkml.org/lkml/2010/2/2/187

Signed-off-by: Giuliano Pochini <pochini@shiny.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 sound/pci/echoaudio/echoaudio.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/sound/pci/echoaudio/echoaudio.c
+++ b/sound/pci/echoaudio/echoaudio.c
@@ -1821,7 +1821,9 @@ static irqreturn_t snd_echo_interrupt(in
 	/* The hardware doesn't tell us which substream caused the irq,
 	thus we have to check all running substreams. */
 	for (ss = 0; ss < DSP_MAXPIPES; ss++) {
-		if ((substream = chip->substream[ss])) {
+		substream = chip->substream[ss];
+		if (substream && ((struct audiopipe *)substream->runtime->
+				private_data)->state == PIPE_STATE_STARTED) {
 			period = pcm_pointer(substream) /
 				substream->runtime->period_size;
 			if (period != chip->last_period[ss]) {



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-07-30 17:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-30 17:16 [146/165] ALSA: Echoaudio, fix Guru Meditation #00000005.48454C50 Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox