[PATCH v2 1/2] HID: i2c-hid: fix size check and type usage

2018-01-07 Thread Aaron Ma
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: sta...@vger.kernel.org Signed-off-by: Aaron Ma ---

[PATCH v2 1/2] HID: i2c-hid: fix size check and type usage

2018-01-07 Thread Aaron Ma
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: sta...@vger.kernel.org Signed-off-by: Aaron Ma ---