]> git.baikalelectronics.ru Git - kernel.git/commit
HID: i2c-hid: fix ret_count check
authorJiri Kosina <jkosina@suse.cz>
Thu, 6 Dec 2012 09:59:28 +0000 (10:59 +0100)
committerJiri Kosina <jkosina@suse.cz>
Thu, 6 Dec 2012 09:59:28 +0000 (10:59 +0100)
commit4060f84a38bf2915249efae5b1a0b7fc9d45ae59
tree9ba2f25c20b765b0e47ea824534e8a29ee1a4c6f
parentf681c75a533e6823169b21087bba493b68542827
HID: i2c-hid: fix ret_count check

ret_count has to be at least 3, as we have to count the 2 bytes that are used
for the size of the reply. Without this, memcpy() might be called with zero or
negative count.

Reported-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/i2c-hid/i2c-hid.c