All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Gabriel A. Devenyi" <ace@staticwave.ca>
To: linux-kernel@vger.kernel.org
Subject: [RESEND] [PATCH] drivers/char/keyboard.c unsigned comparison
Date: Sat, 12 Nov 2005 16:00:10 -0500	[thread overview]
Message-ID: <200511121600.10888.ace@staticwave.ca> (raw)

keycode is a checked for a value less than zero, but is defined as an unsigned int, and is only called in one place in the kernel, and passed a unsigned int, so this comparison is bogus.

Thanks to LinuxICC (http://linuxicc.sf.net)

This patch applies to Linus' git tree as of 12.11.2005

Signed-off-by: Gabriel A. Devenyi <ace@staticwave.ca>

diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 449d029..6e991ea 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -198,7 +198,7 @@ int setkeycode(unsigned int scancode, un
 
 	if (scancode >= dev->keycodemax)
 		return -EINVAL;
-	if (keycode < 0 || keycode > KEY_MAX)
+	if (keycode > KEY_MAX)
 		return -EINVAL;
 	if (dev->keycodesize < sizeof(keycode) && (keycode >> (dev->keycodesize * 8)))
 		return -EINVAL;

-- 
Gabriel A. Devenyi
ace@staticwave.ca

                 reply	other threads:[~2005-11-12 21:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200511121600.10888.ace@staticwave.ca \
    --to=ace@staticwave.ca \
    --cc=linux-kernel@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.