diff options
author | Oliver Neukum <oneukum@suse.com> | 2019-11-15 11:35:05 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-11-20 17:59:28 +0100 |
commit | 5edab14154213a4b6bcc527f60adb6124034a0be (patch) | |
tree | e1d8d1b32f63baee3de14261453e8b864d667767 /drivers/input/ff-memless.c | |
parent | a7a3b07ecaad0acbf56d0da67ae2bd0394657c0f (diff) | |
download | linux-stable-5edab14154213a4b6bcc527f60adb6124034a0be.tar.gz linux-stable-5edab14154213a4b6bcc527f60adb6124034a0be.tar.bz2 linux-stable-5edab14154213a4b6bcc527f60adb6124034a0be.zip |
Input: ff-memless - kill timer in destroy()
commit fa3a5a1880c91bb92594ad42dfe9eedad7996b86 upstream.
No timer must be left running when the device goes away.
Signed-off-by: Oliver Neukum <oneukum@suse.com>
Reported-and-tested-by: syzbot+b6c55daa701fc389e286@syzkaller.appspotmail.com
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/1573726121.17351.3.camel@suse.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/input/ff-memless.c')
-rw-r--r-- | drivers/input/ff-memless.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c index fcc6c3368182..ea3f0f5eb534 100644 --- a/drivers/input/ff-memless.c +++ b/drivers/input/ff-memless.c @@ -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); } |