提交 76530da1 编写于 作者: A Adrian Bunk 提交者: Linus Torvalds

[PATCH] sound/oss/sonicvibes.c: fix an array overflow

This patch fixes an array overflow found by the Coverity checker.
Signed-off-by: NAdrian Bunk <bunk@stusta.de>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 6c207e76
...@@ -1149,7 +1149,7 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg) ...@@ -1149,7 +1149,7 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg)
if (mixtable[i].rec) if (mixtable[i].rec)
break; break;
} }
if (!mixtable[i].rec) if (i == SOUND_MIXER_NRDEVICES)
return 0; return 0;
spin_lock_irqsave(&s->lock, flags); spin_lock_irqsave(&s->lock, flags);
frobindir(s, SV_CIMIX_ADCINL, 0x1f, mixtable[i].rec << 5); frobindir(s, SV_CIMIX_ADCINL, 0x1f, mixtable[i].rec << 5);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册