public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix NR_KEYS off-by-one error
@ 2004-07-16 16:35 OGAWA Hirofumi
  2004-07-16 16:44 ` Vojtech Pavlik
  0 siblings, 1 reply; 25+ messages in thread
From: OGAWA Hirofumi @ 2004-07-16 16:35 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton, vojtech; +Cc: linux-kernel

KDGKBENT ioctl can use 256 entries (0-255), but it was defined as
key_map[NR_KEYS] (NR_KEYS == 255). The code seems also thinking it's 256.

	key_map[0] = U(K_ALLOCATED);
	for (j = 1; j < NR_KEYS; j++)
		key_map[j] = U(K_HOLE);

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
---

 include/linux/keyboard.h |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -puN include/linux/keyboard.h~nr_keys-off-by-one include/linux/keyboard.h
--- linux-2.6.8-rc1/include/linux/keyboard.h~nr_keys-off-by-one	2004-07-16 06:20:10.000000000 +0900
+++ linux-2.6.8-rc1-hirofumi/include/linux/keyboard.h	2004-07-16 06:20:10.000000000 +0900
@@ -16,7 +16,7 @@
 
 #define NR_SHIFT	9
 
-#define NR_KEYS		255
+#define NR_KEYS		256
 #define MAX_NR_KEYMAPS	256
 /* This means 128Kb if all keymaps are allocated. Only the superuser
 	may increase the number of keymaps beyond MAX_NR_OF_USER_KEYMAPS. */
_

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

end of thread, other threads:[~2004-07-30  9:02 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-07-16 16:35 [PATCH] Fix NR_KEYS off-by-one error OGAWA Hirofumi
2004-07-16 16:44 ` Vojtech Pavlik
2004-07-16 17:18   ` OGAWA Hirofumi
2004-07-16 20:15   ` Andries Brouwer
2004-07-17  6:23     ` OGAWA Hirofumi
2004-07-26 22:43       ` Andrew Morton
2004-07-27 13:46         ` Vojtech Pavlik
2004-07-27 16:37           ` OGAWA Hirofumi
2004-07-27 17:54             ` Vojtech Pavlik
2004-07-27 18:35               ` OGAWA Hirofumi
2004-07-28 11:51       ` Andries Brouwer
2004-07-28 16:46         ` OGAWA Hirofumi
2004-07-28 20:42           ` Paul Jackson
2004-07-29  4:10             ` OGAWA Hirofumi
2004-07-29  6:15               ` Paul Jackson
2004-07-29  9:24                 ` OGAWA Hirofumi
2004-07-29  9:49                   ` Paul Jackson
2004-07-29 23:24                     ` Andrew Morton
2004-07-29 23:51                       ` Paul Jackson
2004-07-30  1:25                         ` OGAWA Hirofumi
2004-07-30  7:27                           ` Paul Jackson
2004-07-30  8:07                             ` Vojtech Pavlik
2004-07-30  8:41                               ` Andries Brouwer
2004-07-30  8:51                                 ` Vojtech Pavlik
2004-07-30  9:03                                 ` Vojtech Pavlik

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