From: Adrian Bunk Date: Sun, 1 May 2005 15:59:30 +0000 (-0700) Subject: [PATCH] sound/oss/sonicvibes.c: fix an array overflow X-Git-Tag: v2.6.12-rc4~136^2~13 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=76530da1a9e8ce05963b1f49a098eddc6ec6c534;p=linux-2.6 [PATCH] sound/oss/sonicvibes.c: fix an array overflow This patch fixes an array overflow found by the Coverity checker. Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/sound/oss/sonicvibes.c b/sound/oss/sonicvibes.c index e1d69611a2..06047e7979 100644 --- a/sound/oss/sonicvibes.c +++ b/sound/oss/sonicvibes.c @@ -1149,7 +1149,7 @@ static int mixer_ioctl(struct sv_state *s, unsigned int cmd, unsigned long arg) if (mixtable[i].rec) break; } - if (!mixtable[i].rec) + if (i == SOUND_MIXER_NRDEVICES) return 0; spin_lock_irqsave(&s->lock, flags); frobindir(s, SV_CIMIX_ADCINL, 0x1f, mixtable[i].rec << 5);