mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [UINPUT] Allow EV_ABS to work in uinput.c
@ 2005-05-25 12:26 Ian Campbell
  2005-05-25 12:36 ` Aristeu Sergio Rozanski Filho
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2005-05-25 12:26 UTC (permalink / raw)
  To: Aristeu Sergio Rozanski Filho; +Cc: vojtech, linux-kernel

Hi,

uinput_alloc_device() is supposed to return the number of bytes read,
the value is returned to uinput_write() and from there to userspace. If
EV_ABS is set then it returns the value from uinput_validate_absbits()
instead, which is zero when everything is ok instead of the count.

Signed-off-by: Ian Campbell <icampbell@arcom.com>

%patch
Index: 2.6/drivers/input/misc/uinput.c
===================================================================
--- 2.6.orig/drivers/input/misc/uinput.c	2005-05-25 10:45:56.000000000 +0100
+++ 2.6/drivers/input/misc/uinput.c	2005-05-25 10:47:02.000000000 +0100
@@ -216,9 +216,11 @@
 	/* check if absmin/absmax/absfuzz/absflat are filled as
 	 * told in Documentation/input/input-programming.txt */
 	if (test_bit(EV_ABS, dev->evbit)) {
-		retval = uinput_validate_absbits(dev);
-		if (retval < 0)
+		int err = uinput_validate_absbits(dev);
+		if (err < 0) {
+			retval = err;
 			kfree(dev->name);
+		}
 	}
 
 exit:


-- 
Ian Campbell, Senior Design Engineer
                                        Web: http://www.arcom.com
Arcom, Clifton Road,                    Direct: +44 (0)1223 403 465
Cambridge CB1 7EA, United Kingdom       Phone:  +44 (0)1223 411 200


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

* Re: [UINPUT] Allow EV_ABS to work in uinput.c
  2005-05-25 12:26 [UINPUT] Allow EV_ABS to work in uinput.c Ian Campbell
@ 2005-05-25 12:36 ` Aristeu Sergio Rozanski Filho
  2005-05-31 14:31   ` Vojtech Pavlik
  0 siblings, 1 reply; 3+ messages in thread
From: Aristeu Sergio Rozanski Filho @ 2005-05-25 12:36 UTC (permalink / raw)
  To: Ian Campbell; +Cc: vojtech, linux-kernel

> uinput_alloc_device() is supposed to return the number of bytes read,
> the value is returned to uinput_write() and from there to userspace. If
> EV_ABS is set then it returns the value from uinput_validate_absbits()
> instead, which is zero when everything is ok instead of the count.
> 
> Signed-off-by: Ian Campbell <icampbell@arcom.com>
Acked-by: Aristeu Rozanski <aris@cathedrallabs.org>

> --- 2.6.orig/drivers/input/misc/uinput.c	2005-05-25 10:45:56.000000000 +0100
> +++ 2.6/drivers/input/misc/uinput.c	2005-05-25 10:47:02.000000000 +0100
> @@ -216,9 +216,11 @@
>  	/* check if absmin/absmax/absfuzz/absflat are filled as
>  	 * told in Documentation/input/input-programming.txt */
>  	if (test_bit(EV_ABS, dev->evbit)) {
> -		retval = uinput_validate_absbits(dev);
> -		if (retval < 0)
> +		int err = uinput_validate_absbits(dev);
> +		if (err < 0) {
> +			retval = err;
>  			kfree(dev->name);
> +		}
>  	}
>  
>  exit:

-- 
Aristeu


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

* Re: [UINPUT] Allow EV_ABS to work in uinput.c
  2005-05-25 12:36 ` Aristeu Sergio Rozanski Filho
@ 2005-05-31 14:31   ` Vojtech Pavlik
  0 siblings, 0 replies; 3+ messages in thread
From: Vojtech Pavlik @ 2005-05-31 14:31 UTC (permalink / raw)
  To: Aristeu Sergio Rozanski Filho; +Cc: Ian Campbell, linux-kernel

On Wed, May 25, 2005 at 09:36:26AM -0300, Aristeu Sergio Rozanski Filho wrote:
> > uinput_alloc_device() is supposed to return the number of bytes read,
> > the value is returned to uinput_write() and from there to userspace. If
> > EV_ABS is set then it returns the value from uinput_validate_absbits()
> > instead, which is zero when everything is ok instead of the count.
> > 
> > Signed-off-by: Ian Campbell <icampbell@arcom.com>
> Acked-by: Aristeu Rozanski <aris@cathedrallabs.org>

Thanks; added to my tree.

> > --- 2.6.orig/drivers/input/misc/uinput.c	2005-05-25 10:45:56.000000000 +0100
> > +++ 2.6/drivers/input/misc/uinput.c	2005-05-25 10:47:02.000000000 +0100
> > @@ -216,9 +216,11 @@
> >  	/* check if absmin/absmax/absfuzz/absflat are filled as
> >  	 * told in Documentation/input/input-programming.txt */
> >  	if (test_bit(EV_ABS, dev->evbit)) {
> > -		retval = uinput_validate_absbits(dev);
> > -		if (retval < 0)
> > +		int err = uinput_validate_absbits(dev);
> > +		if (err < 0) {
> > +			retval = err;
> >  			kfree(dev->name);
> > +		}
> >  	}
> >  
> >  exit:
> 
> -- 
> Aristeu
> 
> 

-- 
Vojtech Pavlik
SuSE Labs, SuSE CR

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

end of thread, other threads:[~2005-05-31 14:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-25 12:26 [UINPUT] Allow EV_ABS to work in uinput.c Ian Campbell
2005-05-25 12:36 ` Aristeu Sergio Rozanski Filho
2005-05-31 14:31   ` Vojtech Pavlik

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®