Skip to content

Commit 781bab3

Browse files
digetxdtor
authored andcommitted
Input: elants_i2c - fix division by zero if firmware reports zero phys size
Touchscreen firmware of ASUS Transformer TF700T reports zeros for the phys size. Hence check whether the size is zero and don't set the resolution in this case. Reported-by: Jasper Korten <[email protected]> Signed-off-by: Dmitry Osipenko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent 69d5ff3 commit 781bab3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/input/touchscreen/elants_i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1441,7 +1441,7 @@ static int elants_i2c_probe(struct i2c_client *client,
14411441

14421442
touchscreen_parse_properties(ts->input, true, &ts->prop);
14431443

1444-
if (ts->chip_id == EKTF3624) {
1444+
if (ts->chip_id == EKTF3624 && ts->phy_x && ts->phy_y) {
14451445
/* calculate resolution from size */
14461446
ts->x_res = DIV_ROUND_CLOSEST(ts->prop.max_x, ts->phy_x);
14471447
ts->y_res = DIV_ROUND_CLOSEST(ts->prop.max_y, ts->phy_y);

0 commit comments

Comments
 (0)