]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.32.17/alsa-echoaudio-fix-guru-meditation-00000005.48454c50.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 2.6.32.17 / alsa-echoaudio-fix-guru-meditation-00000005.48454c50.patch
1 From b721e68bdc5b39c51bf6a1469f8d3663fbe03243 Mon Sep 17 00:00:00 2001
2 From: Giuliano Pochini <pochini@shiny.it>
3 Date: Wed, 17 Feb 2010 00:57:44 +0100
4 Subject: ALSA: Echoaudio, fix Guru Meditation #00000005.48454C50
5
6 From: Giuliano Pochini <pochini@shiny.it>
7
8 commit b721e68bdc5b39c51bf6a1469f8d3663fbe03243 upstream.
9
10 This patch fixes a division by zero error in the irq handler.
11
12 There is a small window between the hw_params() callback and when
13 runtime->frame_bits is set by ALSA middle layer. When another substream is
14 already running, if an interrupt is delivered during that window the irq
15 handler calls pcm_pointer() which does a division by zero. The patch below
16 makes the irq handler skip substreams that are initialized but not started
17 yet. Cc to Clemens Ladisch because he proposed an alternate fix.
18
19 For more information, please read the original thread in the linux-kernel
20 mailing list: http://lkml.org/lkml/2010/2/2/187
21
22 Signed-off-by: Giuliano Pochini <pochini@shiny.it>
23 Signed-off-by: Takashi Iwai <tiwai@suse.de>
24 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
25
26 ---
27 sound/pci/echoaudio/echoaudio.c | 4 +++-
28 1 file changed, 3 insertions(+), 1 deletion(-)
29
30 --- a/sound/pci/echoaudio/echoaudio.c
31 +++ b/sound/pci/echoaudio/echoaudio.c
32 @@ -1821,7 +1821,9 @@ static irqreturn_t snd_echo_interrupt(in
33 /* The hardware doesn't tell us which substream caused the irq,
34 thus we have to check all running substreams. */
35 for (ss = 0; ss < DSP_MAXPIPES; ss++) {
36 - if ((substream = chip->substream[ss])) {
37 + substream = chip->substream[ss];
38 + if (substream && ((struct audiopipe *)substream->runtime->
39 + private_data)->state == PIPE_STATE_STARTED) {
40 period = pcm_pointer(substream) /
41 substream->runtime->period_size;
42 if (period != chip->last_period[ss]) {