mirror of
https://github.com/torvalds/linux.git
synced 2024-11-27 06:31:52 +00:00
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>
This commit is contained in:
parent
c921928661
commit
fd4fb262b3
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user