summaryrefslogtreecommitdiffstats
path: root/drivers/char/keyboard.c
diff options
context:
space:
mode:
authorDmitry Torokhov <dtor@insightbb.com>2007-04-12 01:30:52 -0400
committerDmitry Torokhov <dtor@insightbb.com>2007-04-12 01:30:52 -0400
commit9e35d20663344b38339ffb6127ba08285f3397a9 (patch)
treefc0e080afb531f24ac6669d0cca7a9194b9d96fc /drivers/char/keyboard.c
parent887cc127233f34e833d074380f433a04de207563 (diff)
downloadop-kernel-dev-9e35d20663344b38339ffb6127ba08285f3397a9.zip
op-kernel-dev-9e35d20663344b38339ffb6127ba08285f3397a9.tar.gz
Input: keyboard handler - use printk_ratelimit()
Use printk_ratelimit() to protect ourselves from buggy drivers or devices endlessly generating invalid events. Suggested by Andrew Morton. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/char/keyboard.c')
-rw-r--r--drivers/char/keyboard.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c
index 5971254..c06e86a 100644
--- a/drivers/char/keyboard.c
+++ b/drivers/char/keyboard.c
@@ -1135,7 +1135,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw)
if ((raw_mode = (kbd->kbdmode == VC_RAW)) && !hw_raw)
if (emulate_raw(vc, keycode, !down << 7))
- if (keycode < BTN_MISC)
+ if (keycode < BTN_MISC && printk_ratelimit())
printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode);
#ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */
OpenPOWER on IntegriCloud