linux/drivers/hid/i2c-hid
Jean-Baptiste Maneyrol 6296f4a8eb HID: i2c-hid: fix race condition reading reports
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>
Cc: stable@vger.kernel.org
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2014-11-25 15:24:54 +01:00
..
i2c-hid.c HID: i2c-hid: fix race condition reading reports 2014-11-25 15:24:54 +01:00
Kconfig HID: i2c-hid: enhance Kconfig 2012-12-05 10:55:03 +01:00
Makefile HID: i2c-hid: introduce HID over i2c specification implementation 2012-11-19 11:04:38 +01:00