Commit e40ec6ff authored by Dmitry Torokhov's avatar Dmitry Torokhov

Input: hil-mlc - use del_timer_sync() when unloading the driver

del_timer() does not wait for the timer to finish running before returning
and therefore is technically not safe. Also make sure to enable tasklet
before kicking timer that will schedule it.
Signed-off-by: default avatarDmitry Torokhov <dtor@mail.ru>
parent 898d1053
...@@ -993,10 +993,8 @@ int hil_mlc_unregister(hil_mlc *mlc) ...@@ -993,10 +993,8 @@ int hil_mlc_unregister(hil_mlc *mlc)
static int __init hil_mlc_init(void) static int __init hil_mlc_init(void)
{ {
init_timer(&hil_mlcs_kicker); setup_timer(&hil_mlcs_kicker, &hil_mlcs_timer, 0);
hil_mlcs_kicker.expires = jiffies + HZ; mod_timer(&hil_mlcs_kicker, jiffies + HZ);
hil_mlcs_kicker.function = &hil_mlcs_timer;
add_timer(&hil_mlcs_kicker);
tasklet_enable(&hil_mlcs_tasklet); tasklet_enable(&hil_mlcs_tasklet);
...@@ -1005,7 +1003,7 @@ static int __init hil_mlc_init(void) ...@@ -1005,7 +1003,7 @@ static int __init hil_mlc_init(void)
static void __exit hil_mlc_exit(void) static void __exit hil_mlc_exit(void)
{ {
del_timer(&hil_mlcs_kicker); del_timer_sync(&hil_mlcs_kicker);
tasklet_disable(&hil_mlcs_tasklet); tasklet_disable(&hil_mlcs_tasklet);
tasklet_kill(&hil_mlcs_tasklet); tasklet_kill(&hil_mlcs_tasklet);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment