Skip to content

Commit

Permalink
Input: keyboard handler - use printk_ratelimit()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Dmitry Torokhov committed Apr 12, 2007
1 parent 887cc12 commit 9e35d20
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/char/keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 9e35d20

Please sign in to comment.