From: Dmitry Torokhov Date: Thu, 12 Apr 2007 05:30:52 +0000 (-0400) Subject: Input: keyboard handler - use printk_ratelimit() X-Git-Tag: firefly_0821_release~28496^2~83 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=9e35d20663344b38339ffb6127ba08285f3397a9;p=firefly-linux-kernel-4.4.55.git 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 --- diff --git a/drivers/char/keyboard.c b/drivers/char/keyboard.c index 59712546f911..c06e86ad1dab 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 */