]> git.baikalelectronics.ru Git - kernel.git/commit
HID: i2c-hid: fix size check and type usage
authorAaron Ma <aaron.ma@canonical.com>
Mon, 8 Jan 2018 02:41:40 +0000 (10:41 +0800)
committerJiri Kosina <jkosina@suse.cz>
Fri, 16 Feb 2018 12:30:56 +0000 (13:30 +0100)
commitc5940fd1e0f2b6e634be0bb4ebb3e515c44f3e0c
tree585001fb5e3034667d927e53392ee2f17108747d
parentf27999c1593cc120dc0a9e1b8835bb266ea48dbb
HID: i2c-hid: fix size check and type usage

When convert char array with signed int, if the inbuf[x] is negative then
upper bits will be set to 1. Fix this by using u8 instead of char.

ret_size has to be at least 3, hid_input_report use it after minus 2 bytes.

Cc: stable@vger.kernel.org
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/i2c-hid/i2c-hid.c