From: Jean-Baptiste Maneyrol Date: Wed, 19 Nov 2014 16:46:37 +0000 (+0800) Subject: HID: i2c-hid: fix race condition reading reports X-Git-Tag: omap-for-v3.19/fixes-rc1~112^2^3 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6296f4a8eb86f9abcc370fb7a1a116b8441c17fd;p=pandora-kernel.git 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 [Antonio Borneo: cleanup, rebase to v3.17, submit mainline] Signed-off-by: Antonio Borneo Reviewed-by: Benjamin Tissoires Cc: stable@vger.kernel.org Signed-off-by: Jiri Kosina --- Reading git-diff-tree failed