mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
HID: uHID: fix excepted report type
When uhid_get_report() or uhid_set_report() are called, they emit on the char device a UHID_GET_REPORT or UHID_SET_REPORT message. Then, the protocol says that the user space asnwers with UHID_GET_REPORT_REPLY or UHID_SET_REPORT_REPLY. Unfortunatelly, the current code waits for an event of type UHID_GET_REPORT or UHID_SET_REPORT instead of the reply one. Add 1 to UHID_GET_REPORT or UHID_SET_REPORT to actually wait for the reply, and validate the reply. Signed-off-by: Benjamin Tissoires <[email protected]> Reviewed-by: David Herrmann <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
This commit is contained in:
parent
76c7c4916e
commit
8493ecca74
1 changed files with 1 additions and 1 deletions
|
|
@ -154,7 +154,7 @@ static int __uhid_report_queue_and_wait(struct uhid_device *uhid,
|
|||
|
||||
spin_lock_irqsave(&uhid->qlock, flags);
|
||||
*report_id = ++uhid->report_id;
|
||||
uhid->report_type = ev->type;
|
||||
uhid->report_type = ev->type + 1;
|
||||
uhid->report_running = true;
|
||||
uhid_queue(uhid, ev);
|
||||
spin_unlock_irqrestore(&uhid->qlock, flags);
|
||||
|
|
|
|||
Loading…
Reference in a new issue