mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-29 23:53:32 +00:00
Input: send key up events at disconnect
Emit key up events for all pressed keys/buttons when disconnecting an input device. Cures "stuck" enter key effect when unloading keyboard module. Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
This commit is contained in:
parent
e38de678f6
commit
6d2750c167
1 changed files with 5 additions and 2 deletions
|
@ -1014,9 +1014,12 @@ EXPORT_SYMBOL(input_register_device);
|
|||
void input_unregister_device(struct input_dev *dev)
|
||||
{
|
||||
struct list_head *node, *next;
|
||||
int code;
|
||||
|
||||
if (!dev)
|
||||
return;
|
||||
for (code = 0; code <= KEY_MAX; code++)
|
||||
if (test_bit(code, dev->key))
|
||||
input_report_key(dev, code, 0);
|
||||
input_sync(dev);
|
||||
|
||||
del_timer_sync(&dev->timer);
|
||||
|
||||
|
|
Loading…
Reference in a new issue