aboutsummaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-12-15 00:28:27 +0100
committerAdrian Bunk <bunk@stusta.de>2006-12-15 00:28:27 +0100
commit5bee6f6221c2a1b414120b2d17678ac3421d2e8b (patch)
treeaa9e4c4b3167d9af2249ec4935407e95b3923c23 /sound
parente2cde31279a1e6c0d3b6dbb9a8987c3c017ba4c6 (diff)
[ALSA] sound/pci/rme9652/hdspm.c: fix off-by-one errors
This patch fixes off-by-one errors found by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/rme9652/hdspm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index 103b4d715ff..980b9cd689d 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -474,7 +474,7 @@ static inline unsigned int hdspm_read(struct hdspm * hdspm, unsigned int reg)
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_in_gain(struct hdspm * hdspm, unsigned int chan,
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];
}