mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-17 20:54:10 +00:00
ALSA: gus: fix null pointer dereference on pointer block
[ Upstream commit a0d21bb327
]
The pointer block return from snd_gf1_dma_next_block could be
null, so there is a potential null pointer dereference issue.
Fix this by adding a null check before dereference.
Signed-off-by: Chengfeng Ye <cyeaa@connect.ust.hk>
Link: https://lore.kernel.org/r/20211024104611.9919-1-cyeaa@connect.ust.hk
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
aded7ce6f9
commit
fb80637736
1 changed files with 2 additions and 0 deletions
|
@ -126,6 +126,8 @@ static void snd_gf1_dma_interrupt(struct snd_gus_card * gus)
|
||||||
}
|
}
|
||||||
block = snd_gf1_dma_next_block(gus);
|
block = snd_gf1_dma_next_block(gus);
|
||||||
spin_unlock(&gus->dma_lock);
|
spin_unlock(&gus->dma_lock);
|
||||||
|
if (!block)
|
||||||
|
return;
|
||||||
snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd);
|
snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd);
|
||||||
kfree(block);
|
kfree(block);
|
||||||
#if 0
|
#if 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue