]> git.baikalelectronics.ru Git - kernel.git/commit
Input: edt-ft5x06 - fix access to non-existing register
authorLuca Ceresoli <luca@lucaceresoli.net>
Thu, 7 Sep 2017 21:28:28 +0000 (14:28 -0700)
committerDmitry Torokhov <dmitry.torokhov@gmail.com>
Mon, 11 Sep 2017 21:23:41 +0000 (14:23 -0700)
commitcb01197d6a705bb444ab72e8617d214b4858a51c
treeab0ac28612c4920b26bcda337adf397eed563378
parentafa31990eaf5545f2206ad8fa56612fbf6d429e8
Input: edt-ft5x06 - fix access to non-existing register

reg_addr->reg_report_rate is supposed to exist in M06, not M09.

The driver is written to skip avoids access to non-existing registers
when the register address is NO_REGISTER (0xff). But
reg_addr->reg_report_rate is initialized to 0x00 by devm_kzalloc() (in
edt_ft5x06_ts_probe()) and not changed thereafter. So the checks do
not work and an access to register 0x00 is done.

Fix by setting reg_addr->reg_report_rate to NO_REGISTER.

Also fix the only place where reg_report_rate is checked against zero
instead of NO_REGISTER.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
drivers/input/touchscreen/edt-ft5x06.c