ASoC: Fix NULL pointer dereference in __pxa2xx_pcm_hw_free
authorDaniel Mack <daniel@caiaq.de>
Wed, 8 Jul 2009 17:24:26 +0000 (19:24 +0200)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Thu, 9 Jul 2009 09:36:19 +0000 (10:36 +0100)
Check for rtd->params->drcmr != NULL before accessing it.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/arm/pxa2xx-pcm-lib.c

index 108b643229baecc3ec592eb300fbd4f332936c8c..6205f37d547ce80e0315be9d97fbc7ce7fa9ebe5 100644 (file)
@@ -75,7 +75,7 @@ int __pxa2xx_pcm_hw_free(struct snd_pcm_substream *substream)
 {
        struct pxa2xx_runtime_data *rtd = substream->runtime->private_data;
 
-       if (rtd && rtd->params)
+       if (rtd && rtd->params && rtd->params->drcmr)
                *rtd->params->drcmr = 0;
 
        snd_pcm_set_runtime_buffer(substream, NULL);