]> git.baikalelectronics.ru Git - kernel.git/commit
Input: keyboard - fix lack of locking when traversing handler->h_list
authorDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 2 Dec 2009 05:54:35 +0000 (21:54 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Wed, 2 Dec 2009 05:57:48 +0000 (21:57 -0800)
commitaca9b3797651b71c7be2cfa3a6189c8cb2240ae7
tree6d30e807108ef7d2a56ec43271c45acc357df699
parent3d51eadeddf402cb07e28f2a1d8879f831276344
Input: keyboard - fix lack of locking when traversing handler->h_list

Keyboard handler should not attempt to traverse handler->h_list on
its own, without any locking, otherwise it races with registering
and unregistering of input handles which leads to crashes.

Introduce input_handler_for_each_handle() helper that allows safely
iterate over all handles attached to a particular handler and switch
keyboard handler to use it.

Reported-by: Jim Paradis <jparadis@redhat.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/char/keyboard.c
drivers/input/input.c
include/linux/input.h