Skip to content

Commit

Permalink
Input: ff-memless - kill timer in destroy()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Oliver Neukum authored and Dmitry Torokhov committed Nov 15, 2019
1 parent 79aae6a commit fa3a5a1
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions drivers/input/ff-memless.c
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,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);
}

Expand Down

0 comments on commit fa3a5a1

Please sign in to comment.