Commit fd4fb262 authored by Prasad Joshi's avatar Prasad Joshi Committed by Mark Brown

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: default avatarPrasad Joshi <prasadjoshi.linux@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
parent c9219286
...@@ -138,7 +138,7 @@ static void spear_pcm_free(struct snd_pcm *pcm) ...@@ -138,7 +138,7 @@ static void spear_pcm_free(struct snd_pcm *pcm)
continue; continue;
buf = &substream->dma_buffer; buf = &substream->dma_buffer;
if (!buf && !buf->area) if (!buf || !buf->area)
continue; continue;
dma_free_writecombine(pcm->card->dev, buf->bytes, dma_free_writecombine(pcm->card->dev, buf->bytes,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment