public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Adrian Bunk <bunk@stusta.de>
To: vojtech@suse.cz
Cc: linux-input@atrey.karlin.mff.cuni.cz, linux-kernel@vger.kernel.org
Subject: [2.6 patch] drivers/input/keyboard/atkbd.c: fix off by one errors
Date: Thu, 24 Mar 2005 04:17:56 +0100	[thread overview]
Message-ID: <20050324031756.GZ1948@stusta.de> (raw)

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


             reply	other threads:[~2005-03-24  3:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-24  3:17 Adrian Bunk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2005-05-13 14:00 [2.6 patch] drivers/input/keyboard/atkbd.c: fix off by one errors Adrian Bunk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050324031756.GZ1948@stusta.de \
    --to=bunk@stusta.de \
    --cc=linux-input@atrey.karlin.mff.cuni.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=vojtech@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox