lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230727-ads7846-pressure-v1-1-fa74c7680191@skidata.com>
Date:   Thu, 27 Jul 2023 17:19:57 +0200
From:   Benjamin Bara <bbara93@...il.com>
To:     Dmitry Torokhov <dmitry.torokhov@...il.com>
Cc:     linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
        Benjamin Bara <benjamin.bara@...data.com>
Subject: [PATCH] Input: ads7846 - don't set ABS_PRESSURE when min == max

From: Benjamin Bara <benjamin.bara@...data.com>

When the optional fields "pressure_min" and "pressure_max" are not set,
both fall back to 0, which results to the following libinput error:

ADS7846 Touchscreen: kernel bug: device has min == max on ABS_PRESSURE

Avoid it by only setting ABS_PRESSURE if the values differ.

Signed-off-by: Benjamin Bara <benjamin.bara@...data.com>
---
 drivers/input/touchscreen/ads7846.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index faea40dd66d0..2535424a5630 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -1281,7 +1281,7 @@ static int ads7846_probe(struct spi_device *spi)
 			pdata->y_min ? : 0,
 			pdata->y_max ? : MAX_12BIT,
 			0, 0);
-	if (ts->model != 7845)
+	if (ts->model != 7845 && pdata->pressure_min != pdata->pressure_max)
 		input_set_abs_params(input_dev, ABS_PRESSURE,
 				pdata->pressure_min, pdata->pressure_max, 0, 0);
 

---
base-commit: 451cc82bd11eb6a374f4dbcfc1cf007eafea91ab
change-id: 20230727-ads7846-pressure-05edfb01887f

Best regards,
-- 
Benjamin Bara <benjamin.bara@...data.com>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ