diff options
author | Jean-Baptiste Maneyrol <jmaneyrol@invensense.com> | 2014-11-20 00:46:37 +0800 |
---|---|---|
committer | Jiri Slaby <jslaby@suse.cz> | 2015-01-26 14:38:48 +0100 |
commit | 5927cd034b1a289e1c73018fc908403c0ce15658 (patch) | |
tree | 89533e7a1b7cc07e6433fc710d5980aca27fbfdf /lib | |
parent | b377e72cf3c79fcba0fad4b0925fde850d353a15 (diff) |
HID: i2c-hid: fix race condition reading reports
commit 6296f4a8eb86f9abcc370fb7a1a116b8441c17fd upstream.
Current driver uses a common buffer for reading reports either
synchronously in i2c_hid_get_raw_report() and asynchronously in
the interrupt handler.
There is race condition if an interrupt arrives immediately after
the report is received in i2c_hid_get_raw_report(); the common
buffer is modified by the interrupt handler with the new report
and then i2c_hid_get_raw_report() proceed using wrong data.
Fix it by using a separate buffers for synchronous reports.
Signed-off-by: Jean-Baptiste Maneyrol <jmaneyrol@invensense.com>
[Antonio Borneo: cleanup, rebase to v3.17, submit mainline]
Signed-off-by: Antonio Borneo <borneo.antonio@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'lib')
0 files changed, 0 insertions, 0 deletions