]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ASoC: spear: correct the check for NULL dma_buffer pointer
authorPrasad Joshi <prasadjoshi.linux@gmail.com>
Fri, 31 Aug 2012 03:25:21 +0000 (08:55 +0530)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Fri, 31 Aug 2012 21:24:52 +0000 (14:24 -0700)
The if condition
if (!buf && !buf->area)

checks if the buf pointer is NULL and then dereferences it again to
check if the buffer area is NULL, resulting in possible NULL
dereference.

Signed-off-by: Prasad Joshi <prasadjoshi.linux@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
sound/soc/spear/spear_pcm.c

index 97c2cac8e92c726712746d5db4658d7f0898e441..8c7f23729446b1582f6d7625d5933aad905e45d7 100644 (file)
@@ -138,7 +138,7 @@ static void spear_pcm_free(struct snd_pcm *pcm)
                        continue;
 
                buf = &substream->dma_buffer;
-               if (!buf && !buf->area)
+               if (!buf || !buf->area)
                        continue;
 
                dma_free_writecombine(pcm->card->dev, buf->bytes,