HID: alps: Report an error if we receive invalid data in 't4_read_write_register()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Mon, 19 Mar 2018 20:53:26 +0000 (21:53 +0100)
committerJiri Kosina <jkosina@suse.cz>
Thu, 26 Apr 2018 12:33:35 +0000 (14:33 +0200)
commit605f077290a594c75a952ad3b78e53d68c1895ae
tree7188e316fd6a492f4097faad80ff8a7586bd2bd4
parent4d1890531413a19d63cb980fee6d9d3ff86d97ad
HID: alps: Report an error if we receive invalid data in 't4_read_write_register()'

If the data received is not what is expected, we should return an error.

Otherwise, we return 0 or a positive value which will be interpreted as
success, but '*read_val' has not been updated.

Fixes: 73196ebe134d ("HID: alps: add support for Alps T4 Touchpad device")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-alps.c