* [2.6 patch] sound/oss/sonicvibes.c: fix an array overflow
@ 2005-03-27 20:38 Adrian Bunk
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2005-03-27 20:38 UTC (permalink / raw)
To: linux-kernel
This patch fixes an array overflow found by the Coverity checker.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.12-rc1-mm1-full/sound/oss/sonicvibes.c.old 2005-03-23 01:53:13.000000000 +0100
+++ linux-2.6.12-rc1-mm1-full/sound/oss/sonicvibes.c 2005-03-23 01:55:11.000000000 +0100
@@ -1146,13 +1146,13 @@ static int mixer_ioctl(struct sv_state *
for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
if (!(val & (1 << i)))
continue;
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);
frobindir(s, SV_CIMIX_ADCINR, 0x1f, mixtable[i].rec << 5);
spin_unlock_irqrestore(&s->lock, flags);
return 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
* [2.6 patch] sound/oss/sonicvibes.c: fix an array overflow
@ 2005-04-09 18:04 Adrian Bunk
0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2005-04-09 18:04 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel
This patch fixes an array overflow found by the Coverity checker.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
---
This patch was already sent on:
- 27 Mar 2005
--- linux-2.6.12-rc1-mm1-full/sound/oss/sonicvibes.c.old 2005-03-23 01:53:13.000000000 +0100
+++ linux-2.6.12-rc1-mm1-full/sound/oss/sonicvibes.c 2005-03-23 01:55:11.000000000 +0100
@@ -1146,13 +1146,13 @@ static int mixer_ioctl(struct sv_state *
for (i = 0; i < SOUND_MIXER_NRDEVICES; i++) {
if (!(val & (1 << i)))
continue;
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);
frobindir(s, SV_CIMIX_ADCINR, 0x1f, mixtable[i].rec << 5);
spin_unlock_irqrestore(&s->lock, flags);
return 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-04-09 18:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-03-27 20:38 [2.6 patch] sound/oss/sonicvibes.c: fix an array overflow Adrian Bunk
-- strict thread matches above, loose matches on Subject: below --
2005-04-09 18:04 Adrian Bunk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox