diff mbox series

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

Message ID 20180918052256.GA23446@jelly (mailing list archive)
State Accepted
Headers show
Series Input: uinput - allow for max == min during input_absinfo validation | expand

Commit Message

Peter Hutterer Sept. 18, 2018, 5:22 a.m. UTC
These values are inclusive, so a range of 1 requires min == max.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
---
 drivers/input/misc/uinput.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin Kepplinger Sept. 18, 2018, 11:13 a.m. UTC | #1
On 9/18/18 7:22 AM, Peter Hutterer wrote:
> These values are inclusive, so a range of 1 requires min == max.
> 
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

true, nice catch.

Reviewed-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>
Dmitry Torokhov Sept. 18, 2018, 5:05 p.m. UTC | #2
On Tue, Sep 18, 2018 at 01:13:47PM +0200, Martin Kepplinger wrote:
> On 9/18/18 7:22 AM, Peter Hutterer wrote:
> > These values are inclusive, so a range of 1 requires min == max.
> > 
> > Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
> 
> true, nice catch.
> 
> Reviewed-by: Martin Kepplinger <martin.kepplinger@ginzinger.com>

Applied, thank you.
diff mbox series

Patch

diff --git a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
index 96a887f33698..eb14ddf69346 100644
--- a/drivers/input/misc/uinput.c
+++ b/drivers/input/misc/uinput.c
@@ -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);