summaryrefslogtreecommitdiffstats
path: root/sound/soc/spear
diff options
context:
space:
mode:
authorPrasad Joshi <prasadjoshi.linux@gmail.com>2012-08-31 08:55:21 +0530
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-08-31 14:24:52 -0700
commitfd4fb262b31ecb06bf93defb036e72b33ddf0200 (patch)
tree1649a8e8ab2e7fb5ac43f8ebcfe04e732cae9d42 /sound/soc/spear
parentc921928661eda599d73a6a86e58bdd5aecfa18cb (diff)
downloadlinux-fd4fb262b31ecb06bf93defb036e72b33ddf0200.tar.bz2
ASoC: spear: correct the check for NULL dma_buffer pointer
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>
Diffstat (limited to 'sound/soc/spear')
-rw-r--r--sound/soc/spear/spear_pcm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/soc/spear/spear_pcm.c b/sound/soc/spear/spear_pcm.c
index 97c2cac8e92c..8c7f23729446 100644
--- a/sound/soc/spear/spear_pcm.c
+++ b/sound/soc/spear/spear_pcm.c
@@ -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,