linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Input: uinput - allow for max == min during input_absinfo validation
@ 2018-09-18  5:22 Peter Hutterer
  2018-09-18 11:13 ` Martin Kepplinger
  0 siblings, 1 reply; 3+ messages in thread
From: Peter Hutterer @ 2018-09-18  5:22 UTC (permalink / raw)
  To: dmitry.torokhov, linux-input, linux-kernel; +Cc: Benjamin Tissoires

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(-)

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);
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: uinput - allow for max == min during input_absinfo validation
  2018-09-18  5:22 [PATCH] Input: uinput - allow for max == min during input_absinfo validation Peter Hutterer
@ 2018-09-18 11:13 ` Martin Kepplinger
  2018-09-18 17:05   ` Dmitry Torokhov
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Kepplinger @ 2018-09-18 11:13 UTC (permalink / raw)
  To: Peter Hutterer, dmitry.torokhov, linux-input, linux-kernel
  Cc: Benjamin Tissoires

[-- Attachment #1: Type: text/plain, Size: 256 bytes --]

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>

[-- Attachment #2: smime.p7s --]
[-- Type: application/x-pkcs7-signature, Size: 3616 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Input: uinput - allow for max == min during input_absinfo validation
  2018-09-18 11:13 ` Martin Kepplinger
@ 2018-09-18 17:05   ` Dmitry Torokhov
  0 siblings, 0 replies; 3+ messages in thread
From: Dmitry Torokhov @ 2018-09-18 17:05 UTC (permalink / raw)
  To: Martin Kepplinger
  Cc: Peter Hutterer, linux-input, linux-kernel, Benjamin Tissoires

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.

-- 
Dmitry

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-09-18 17:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-18  5:22 [PATCH] Input: uinput - allow for max == min during input_absinfo validation Peter Hutterer
2018-09-18 11:13 ` Martin Kepplinger
2018-09-18 17:05   ` Dmitry Torokhov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).