[PATCH 7/11] input: Fixes for the uinput userspace

Vojtech Pavlik (vojtech@ucw.cz)
Sat, 21 Jun 2003 15:51:57 +0200


You can pull this changeset from:
bk://kernel.bkbits.net/vojtech/input

===================================================================

ChangeSet@1.1365, 2003-06-21 04:43:13-07:00, neilb@cse.unsw.edu.au
input: Three fixes for the uinput userspace input device driver.

uinput.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)

===================================================================

diff -Nru a/drivers/input/misc/uinput.c b/drivers/input/misc/uinput.c
--- a/drivers/input/misc/uinput.c Sat Jun 21 15:25:36 2003
+++ b/drivers/input/misc/uinput.c Sat Jun 21 15:25:36 2003
@@ -49,11 +49,11 @@

udev = (struct uinput_device *)dev->private;

- udev->head = (udev->head + 1) % UINPUT_BUFFER_SIZE;
udev->buff[udev->head].type = type;
udev->buff[udev->head].code = code;
udev->buff[udev->head].value = value;
do_gettimeofday(&udev->buff[udev->head].time);
+ udev->head = (udev->head + 1) % UINPUT_BUFFER_SIZE;

wake_up_interruptible(&udev->waitq);

@@ -82,6 +82,7 @@
udev->dev->event = uinput_dev_event;
udev->dev->upload_effect = uinput_dev_upload_effect;
udev->dev->erase_effect = uinput_dev_erase_effect;
+ udev->dev->private = udev;

init_waitqueue_head(&(udev->waitq));

@@ -264,7 +265,7 @@
return -ENODEV;

while ((udev->head != udev->tail) &&
- (retval + sizeof(struct uinput_device) <= count)) {
+ (retval + sizeof(struct input_event) <= count)) {
if (copy_to_user(buffer + retval, &(udev->buff[udev->tail]),
sizeof(struct input_event))) return -EFAULT;
udev->tail = (udev->tail + 1) % UINPUT_BUFFER_SIZE;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/