public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [2.6 patch] drivers/input/keyboard/atkbd.c: fix off by one errors
@ 2005-03-24  3:17 Adrian Bunk
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2005-03-24  3:17 UTC (permalink / raw)
  To: vojtech; +Cc: linux-input, linux-kernel

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@stusta.de>

--- 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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [2.6 patch] drivers/input/keyboard/atkbd.c: fix off by one errors
@ 2005-05-13 14:00 Adrian Bunk
  0 siblings, 0 replies; 2+ messages in thread
From: Adrian Bunk @ 2005-05-13 14:00 UTC (permalink / raw)
  To: Andrew Morton; +Cc: vojtech, linux-input, linux-kernel

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@stusta.de>

---

This patch was already sent on:
- 24 Mar 2005

--- 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);


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-05-13 14:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-05-13 14:00 [2.6 patch] drivers/input/keyboard/atkbd.c: fix off by one errors Adrian Bunk
  -- strict thread matches above, loose matches on Subject: below --
2005-03-24  3:17 Adrian Bunk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox