Skip to contentSkip to conversation

Input: uinput - allow for max == min during input_absinfo validation

PATCH Applied Peter Hutterer 3 participants 3 messages Sep 18, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Input: uinput - allow for max == min during input_absinfo validation

These values are inclusive, so a range of 1 requires min == max.

---
 drivers/input/misc/uinput.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/input/misc/uinput.c +1 -1
index 96a887f33698..eb14ddf69346 100644
@@ -410,7 +410,7 @@ static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code,
 	min = abs->minimum;
 	max = abs->maximum;
 
-	if ((min != 0 || max != 0) && max <= min) {
+	if ((min != 0 || max != 0) && max < min) {
 		printk(KERN_DEBUG
 		       "%s: invalid abs[%02x] min:%d max:%d\n",
 		       UINPUT_NAME, code, min, max);
Signature · 1 line
2.17.1