aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/input/keyboard
diff options
context:
space:
mode:
authorJiri Pirko <jpirko@redhat.com>2008-11-11 09:43:21 -0500
committerDmitry Torokhov <dmitry.torokhov@gmail.com>2008-11-11 11:31:59 -0500
commitd6d79a785d430c0e17f7e2d662f10de022cbca93 (patch)
tree5d31c85df3b3d8483a832d8d0926f8f6484f66ea /drivers/input/keyboard
parenta8215b81cc31cf267506bc6a4a4bfe93f4ca1652 (diff)
Input: atkbd - cancel delayed work before freeing its structure
Pointed out by Oleg Nesterov. Since delayed work is used here, use of flush_scheduled_work() is not sufficient in atkbd_disconnect(). It does not wait for scheduled delayed work to finish. This patch prevents delayed work to be processed after freeing atkbd structure (used struct delayed_work is part of atkbd) by cancelling this delayed work. Signed-off-by: Jiri Pirko <jpirko@redhat.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/input/keyboard')
-rw-r--r--drivers/input/keyboard/atkbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index c93b9b4ff03a..379b7ff354ec 100644
--- a/drivers/input/keyboard/atkbd.c
+++ b/drivers/input/keyboard/atkbd.c
@@ -824,7 +824,7 @@ static void atkbd_disconnect(struct serio *serio)
824 atkbd_disable(atkbd); 824 atkbd_disable(atkbd);
825 825
826 /* make sure we don't have a command in flight */ 826 /* make sure we don't have a command in flight */
827 flush_scheduled_work(); 827 cancel_delayed_work_sync(&atkbd->event_work);
828 828
829 sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group); 829 sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group);
830 input_unregister_device(atkbd->dev); 830 input_unregister_device(atkbd->dev);