Skip to content

Commit

Permalink
ASoC: spear: correct the check for NULL dma_buffer pointer
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Prasad Joshi authored and Mark Brown committed Aug 31, 2012
1 parent c921928 commit fd4fb26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/spear/spear_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit fd4fb26

Please sign in to comment.