summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorRoel Kluin <roel.kluin@gmail.com>2009-12-27 22:26:47 +0100
committerTakashi Iwai <tiwai@suse.de>2009-12-28 12:14:39 +0100
commit9980c6209ebc2a02eb3ca51a4fae1e17f645c868 (patch)
tree38e7bf98aeb252c18260ed8ed83a0c45b5061be9 /sound
parentdfb12eeb0f04b37e5eb3858864d074af4ecd2ac7 (diff)
downloadlinux-9980c6209ebc2a02eb3ca51a4fae1e17f645c868.tar.gz
ALSA: test off by one in setsamplerate()
With `while (i++ < MAX_WRITE_RETRY)' i reaches MAX_WRITE_RETRY + 1 after the loop Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/riptide/riptide.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sound/pci/riptide/riptide.c b/sound/pci/riptide/riptide.c
index b5ca02e2038c..e66ef2b69b5d 100644
--- a/sound/pci/riptide/riptide.c
+++ b/sound/pci/riptide/riptide.c
@@ -1058,7 +1058,7 @@ setsamplerate(struct cmdif *cif, unsigned char *intdec, unsigned int rate)
rptr.retwords[2] != M &&
rptr.retwords[3] != N &&
i++ < MAX_WRITE_RETRY);
- if (i == MAX_WRITE_RETRY) {
+ if (i > MAX_WRITE_RETRY) {
snd_printdd("sent samplerate %d: %d failed\n",
*intdec, rate);
return -EIO;