From: Jiri Pirko Date: Tue, 11 Nov 2008 14:43:21 +0000 (-0500) Subject: Input: atkbd - cancel delayed work before freeing its structure X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=d6d79a785d430c0e17f7e2d662f10de022cbca93;p=deliverable%2Flinux.git 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 Signed-off-by: Dmitry Torokhov --- 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) atkbd_disable(atkbd); /* make sure we don't have a command in flight */ - flush_scheduled_work(); + cancel_delayed_work_sync(&atkbd->event_work); sysfs_remove_group(&serio->dev.kobj, &atkbd_attribute_group); input_unregister_device(atkbd->dev);