projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3f8da4b
)
ALSA: gus: fix null pointer dereference on pointer block
author
Chengfeng Ye
<cyeaa@connect.ust.hk>
Sun, 24 Oct 2021 10:46:11 +0000
(
03:46
-0700)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:30 +0000
(09:48 +0100)
[ Upstream commit
a0d21bb3279476c777434c40d969ea88ca64f9aa
]
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>
sound/isa/gus/gus_dma.c
patch
|
blob
|
history
diff --git
a/sound/isa/gus/gus_dma.c
b/sound/isa/gus/gus_dma.c
index a1c770d826ddab1d6ed6d2f6c34aadcdf25d2701..6d664dd8dde0b4fe5b54bf3ea35bca454d81d493 100644
(file)
--- a/
sound/isa/gus/gus_dma.c
+++ b/
sound/isa/gus/gus_dma.c
@@
-126,6
+126,8
@@
static void snd_gf1_dma_interrupt(struct snd_gus_card * gus)
}
block = snd_gf1_dma_next_block(gus);
spin_unlock(&gus->dma_lock);
+ if (!block)
+ return;
snd_gf1_dma_program(gus, block->addr, block->buf_addr, block->count, (unsigned short) block->cmd);
kfree(block);
#if 0