]> git.baikalelectronics.ru Git - kernel.git/commit
Input: polldev can cause crash in case when polling disabled
authorSamu Onkalo <samu.p.onkalo@nokia.com>
Sat, 20 Feb 2010 07:17:58 +0000 (23:17 -0800)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Sat, 20 Feb 2010 09:23:55 +0000 (01:23 -0800)
commitbbabf6f4ede45e3cb6dd85bef961448d8bc6a1c7
treec8565964e0d4566d1b5ef912c12c64b773b00e70
parent6bb81905279e9246603a79b509458480c6d364be
Input: polldev can cause crash in case when polling disabled

When polled input device is opened and closed and there are no other
users of polled device, the workqueue is created and destroyed in
every open / close operation. It is probable that at some point
dynamic allocation of internal parts of the workqueue cause changes to the
workqueue.

When a work is queued to the workqueue the work struct contains pointers
to the workqueue data. If the workqueue has been changed and the work
has never been queued to the new workqueue, work-struct contains pointers
to the non-existing workqueue. This will cause crash at the work
cancellation during device close since cancellation of a work assumes
that the workqueue exists.

To prevent that, work struct is cleaned up at device close. This keeps
work struct clean for the next use.

Signed-off-by: Samu Onkalo <samu.p.onkalo@nokia.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
drivers/input/input-polldev.c