From: Dmitry Torokhov Date: Thu, 9 Oct 2008 03:42:26 +0000 (-0400) Subject: Input: keyboard - fix potential out of bound access to key_map X-Git-Tag: v2.6.28-rc1~289^2^2~6 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=161c609173c40a39dc218d97a4a86592dfda31ba;p=linux-2.6-omap-h63xx.git Input: keyboard - fix potential out of bound access to key_map Reported-by: Michal Roszkowski Signed-off-by: Dmitry Torokhov --- diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 7b3a212c86b..de26a978fbd 100644 --- a/drivers/char/keyboard.c +++ b/drivers/char/keyboard.c @@ -1249,7 +1249,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw) return; } - if (keycode > NR_KEYS) + if (keycode >= NR_KEYS) if (keycode >= KEY_BRL_DOT1 && keycode <= KEY_BRL_DOT8) keysym = K(KT_BRL, keycode - KEY_BRL_DOT1 + 1); else