[PATCH 5/9] [UBUNTU:sound/pci/rme9652] Fix off-by-ones in RME9652 driver

crimsun at fungus.sh.nu crimsun at fungus.sh.nu
Tue Mar 28 08:18:20 UTC 2006


Subject: [PATCH 5/9] [UBUNTU:sound/pci/rme9652] Fix off-by-ones in RME9652 driver

UpstreamStatus: Applied, http://kernel.org/git/?p=linux/kernel/git/perex/alsa-current.git;a=commitdiff;h=5bab2482083077d1e14644db2546c54534156849

This patch from Adrian Bunk fixes off-by-one errors in the RME9652
driver found by the Coverity checker.

Signed-off-by: Daniel T Chen <crimsun at ubuntu.com>

---

 sound/pci/rme9652/hdspm.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

2bca360b81dfaa3a79e698e9f663f32550f82eda
diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c
index a1aef6f..4846e98 100644
--- a/sound/pci/rme9652/hdspm.c
+++ b/sound/pci/rme9652/hdspm.c
@@ -477,7 +477,7 @@ static inline unsigned int hdspm_read(hd
 static inline int hdspm_read_in_gain(hdspm_t * 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];
@@ -486,7 +486,7 @@ static inline int hdspm_read_in_gain(hds
 static inline int hdspm_read_pb_gain(hdspm_t * 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];
 }
-- 
1.1.3


-- 
Daniel T. Chen            crimsun at ubuntu.com
GPG key:   www.sh.nu/~crimsun/pubkey.gpg.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20060328/ef422e98/attachment.sig>


More information about the kernel-team mailing list