Skip to content
Snippets Groups Projects
Commit 9e35d206 authored by Dmitry Torokhov's avatar Dmitry Torokhov
Browse files

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: default avatarDmitry Torokhov <dtor@mail.ru>
parent 887cc127
No related merge requests found
...@@ -1135,7 +1135,7 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw) ...@@ -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 ((raw_mode = (kbd->kbdmode == VC_RAW)) && !hw_raw)
if (emulate_raw(vc, keycode, !down << 7)) 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); printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode);
#ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */ #ifdef CONFIG_MAGIC_SYSRQ /* Handle the SysRq Hack */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment