mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 19:51:31 -04:00
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: 73196ebe13 ("HID: alps: add support for Alps T4 Touchpad device")
Signed-off-by: Christophe JAILLET <[email protected]>
Signed-off-by: Jiri Kosina <[email protected]>
This commit is contained in:
parent
4d18905314
commit
605f077290
1 changed files with 2 additions and 0 deletions
|
|
@ -219,6 +219,8 @@ static int t4_read_write_register(struct hid_device *hdev, u32 address,
|
|||
goto exit_readbuf;
|
||||
}
|
||||
|
||||
ret = -EINVAL;
|
||||
|
||||
if (*(u32 *)&readbuf[6] != address) {
|
||||
dev_err(&hdev->dev, "read register address error (%x,%x)\n",
|
||||
*(u32 *)&readbuf[6], address);
|
||||
|
|
|
|||
Loading…
Reference in a new issue