[RAMEN9610-21500]Input: ff-memless - kill timer in destroy()
[GitHub/LineageOS/android_kernel_motorola_exynos9610.git] / drivers / input / ff-memless.c
index fcc6c3368182b9c376c01a4506d60a276dbceb1a..ea3f0f5eb534667b6ab15cc88c3acaf6a39121f0 100644 (file)
@@ -501,6 +501,15 @@ static void ml_ff_destroy(struct ff_device *ff)
 {
        struct ml_device *ml = ff->private;
 
+       /*
+        * Even though we stop all playing effects when tearing down
+        * an input device (via input_device_flush() that calls into
+        * input_ff_flush() that stops and erases all effects), we
+        * do not actually stop the timer, and therefore we should
+        * do it here.
+        */
+       del_timer_sync(&ml->timer);
+
        kfree(ml->private);
 }