[2.6 patch] drivers/input/keyboard/atkbd.c: fix off by one errors
From: Adrian Bunk
Date: Wed Mar 23 2005 - 22:27:05 EST
This patch fixes two possible off by one errors found by the Coverity
checker (look at the period[i] and delay[j] in the two first unchanged
lines).
Signed-off-by: Adrian Bunk <bunk@xxxxxxxxx>
--- linux-2.6.12-rc1-mm1-full/drivers/input/keyboard/atkbd.c.old 2005-03-24 02:46:57.000000000 +0100
+++ linux-2.6.12-rc1-mm1-full/drivers/input/keyboard/atkbd.c 2005-03-24 02:47:24.000000000 +0100
@@ -468,8 +468,8 @@ static int atkbd_event(struct input_dev
if (atkbd->softrepeat) return 0;
i = j = 0;
- while (i < 32 && period[i] < dev->rep[REP_PERIOD]) i++;
- while (j < 4 && delay[j] < dev->rep[REP_DELAY]) j++;
+ while (i < 31 && period[i] < dev->rep[REP_PERIOD]) i++;
+ while (j < 3 && delay[j] < dev->rep[REP_DELAY]) j++;
dev->rep[REP_PERIOD] = period[i];
dev->rep[REP_DELAY] = delay[j];
param[0] = i | (j << 5);
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/