diff options
author | Stefan Kerkmann <karlk90@pm.me> | 2023-08-02 13:47:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-02 13:47:25 +0200 |
commit | b2d068d1aa95265f16670cbf5a68da745602fc12 (patch) | |
tree | 650c658f69a6bffd62f12358360e3306804820dd /quantum/backlight | |
parent | 7fbc4153e8e27dd8c6456eef6e5ab5b01ed83ab9 (diff) |
Fix mouse-key spamming empty reports (#21663)
Problem:
`mousekey_task` spams empty hid reports with when a mouse key is
pressed, causing resource exhaustion in the USB mouse endpoint.
Cause:
The check whether or not to send a new mouse report would always
evaluate to true if a mouse key is pressed:
1. `mouse_report` has non-zero fields and `tmpmr` is a copy of this
fields.
2. `mouse_report` is set to zero, `tmpmr` has now non-zero fields.
3. `has_mouse_report_changed` compares the two and evaluates to true
4. a mouse report is sent.
Fix:
The check condition of `has_mouse_report_changed` will evaluate any
empty record as unchanged, as mouse report data is relative and doesn't
need to return to zero. An empty report will still be send by
`register_mouse` on release of all mouse buttons.
Diffstat (limited to 'quantum/backlight')
0 files changed, 0 insertions, 0 deletions