HID: i2c-hid: fix i2c_hid_get_raw_report count mismatches
authorBenjamin Tissoires <benjamin.tissoires@gmail.com>
Wed, 5 Dec 2012 14:02:56 +0000 (15:02 +0100)
committerJiri Kosina <jkosina@suse.cz>
Thu, 6 Dec 2012 09:58:42 +0000 (10:58 +0100)
The previous memcpy implementation relied on the size advertized by the
device. There were no guarantees that buf was big enough.

Some gymnastic is also required with the +2/-2 to take into account
the first 2 bytes of the returned buffer where the total returned
length is supplied by the device.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>

No differences found