Skip to content

Commit

Permalink
Input: atkbd - cancel delayed work before freeing its structure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Pirko authored and Dmitry Torokhov committed Nov 11, 2008
1 parent a8215b8 commit d6d79a7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/input/keyboard/atkbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit d6d79a7

Please sign in to comment.