aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorAdrian Bunk <bunk@stusta.de>2006-03-13 08:15:04 -0500
committerJaroslav Kysela <perex@suse.cz>2006-03-22 04:38:14 -0500
commit5bab2482083077d1e14644db2546c54534156849 (patch)
tree5100dda7dfbe10844dae124c3171a61ada930f54 /sound
parent3a63e44420932852efd6a7d6d46cdad4d427f880 (diff)
[ALSA] sound/pci/rme9652/hdspm.c: fix off-by-one errors
Modules: RME9652 driver This patch fixes off-by-one errors found by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Takashi Iwai <tiwai@suse.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 103b4d715ff4..980b9cd689dd 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)
474static inline int hdspm_read_in_gain(struct hdspm * hdspm, unsigned int chan, 474static inline int hdspm_read_in_gain(struct hdspm * hdspm, unsigned int chan,
475 unsigned int in) 475 unsigned int in)
476{ 476{
477 if (chan > HDSPM_MIXER_CHANNELS || in > HDSPM_MIXER_CHANNELS) 477 if (chan >= HDSPM_MIXER_CHANNELS || in >= HDSPM_MIXER_CHANNELS)
478 return 0; 478 return 0;
479 479
480 return hdspm->mixer->ch[chan].in[in]; 480 return hdspm->mixer->ch[chan].in[in];
@@ -483,7 +483,7 @@ static inline int hdspm_read_in_gain(struct hdspm * hdspm, unsigned int chan,
483static inline int hdspm_read_pb_gain(struct hdspm * hdspm, unsigned int chan, 483static inline int hdspm_read_pb_gain(struct hdspm * hdspm, unsigned int chan,
484 unsigned int pb) 484 unsigned int pb)
485{ 485{
486 if (chan > HDSPM_MIXER_CHANNELS || pb > HDSPM_MIXER_CHANNELS) 486 if (chan >= HDSPM_MIXER_CHANNELS || pb >= HDSPM_MIXER_CHANNELS)
487 return 0; 487 return 0;
488 return hdspm->mixer->ch[chan].pb[pb]; 488 return hdspm->mixer->ch[chan].pb[pb];
489} 489}