linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] atkbd: cancel delayed work before freeing its structure
@ 2008-11-05 14:31 Jiri Pirko
  2008-11-07 15:43 ` Oleg Nesterov
  0 siblings, 1 reply; 6+ messages in thread
From: Jiri Pirko @ 2008-11-05 14:31 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-input, dmitry.torokhov, oleg

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.

Jirka

Signed-off-by: Jiri Pirko <jpirko@redhat.com>
---
 drivers/input/keyboard/atkbd.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
index 22016ca..f3bbf49 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);
-- 
1.5.6.5


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-11-11 17:23 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-05 14:31 [PATCH] atkbd: cancel delayed work before freeing its structure Jiri Pirko
2008-11-07 15:43 ` Oleg Nesterov
2008-11-11 14:51   ` Dmitry Torokhov
2008-11-11 17:20     ` Oleg Nesterov
2008-11-11 16:30       ` Dmitry Torokhov
2008-11-11 18:24         ` Oleg Nesterov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).