]> err.no Git - linux-2.6/commitdiff
[ALSA] ASoC at91 - Fix NULL pointer dereference in at91_i2s_shutdown
authorFrank Mandarino <fmandarino@endrelia.com>
Mon, 8 Jan 2007 09:58:47 +0000 (10:58 +0100)
committerJaroslav Kysela <perex@suse.cz>
Fri, 9 Feb 2007 08:02:54 +0000 (09:02 +0100)
This patch fixes a NULL pointer exception which occurs when a
substream is opened and immediately closed.

Signed-off-by: Frank Mandarino <fmandarino@endrelia.com>
Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
sound/soc/at91/at91-i2s.c

index 203e6948cd99d66074c827bee03c39874753cfa1..876d391c7013b4fcfcb81c2c142aaf519c1f13ea 100644 (file)
@@ -296,6 +296,13 @@ static int at91_i2s_startup(struct snd_pcm_substream *substream)
        ssc_p->dir_mask |= dir_mask;
        spin_unlock_irq(&ssc_p->lock);
 
+       /*
+        * dma_data is not set until hw_params() is called and
+        * shutdown() depends on this value being NULL if hw_params()
+        * was not called.
+        */
+       rtd->cpu_dai->dma_data = NULL;
+
        return 0;
 }