* [2.6 patch] sound/pci/rme9652/hdspm.c: fix off-by-one errors
@ 2006-03-11 3:43 Adrian Bunk
0 siblings, 0 replies; only message in thread
From: Adrian Bunk @ 2006-03-11 3:43 UTC (permalink / raw)
To: perex; +Cc: alsa-devel, linux-kernel
This patch fixes off-by-one errors found by the Coverity checker.
Signed-off-by: Adrian Bunk <bunk@stusta.de>
--- linux-2.6.16-rc5-mm3-full/sound/pci/rme9652/hdspm.c.old 2006-03-11 03:11:15.000000000 +0100
+++ linux-2.6.16-rc5-mm3-full/sound/pci/rme9652/hdspm.c 2006-03-11 03:12:10.000000000 +0100
@@ -474,7 +474,7 @@
static inline int hdspm_read_in_gain(struct hdspm * hdspm, unsigned int chan,
unsigned int in)
{
- if (chan > HDSPM_MIXER_CHANNELS || in > HDSPM_MIXER_CHANNELS)
+ if (chan >= HDSPM_MIXER_CHANNELS || in >= HDSPM_MIXER_CHANNELS)
return 0;
return hdspm->mixer->ch[chan].in[in];
@@ -483,7 +483,7 @@
static inline int hdspm_read_pb_gain(struct hdspm * hdspm, unsigned int chan,
unsigned int pb)
{
- if (chan > HDSPM_MIXER_CHANNELS || pb > HDSPM_MIXER_CHANNELS)
+ if (chan >= HDSPM_MIXER_CHANNELS || pb >= HDSPM_MIXER_CHANNELS)
return 0;
return hdspm->mixer->ch[chan].pb[pb];
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2006-03-11 3:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-11 3:43 [2.6 patch] sound/pci/rme9652/hdspm.c: fix off-by-one errors Adrian Bunk
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox