summaryrefslogtreecommitdiff
path: root/drivers/input/evdev.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@home.osdl.org>2003-09-20 04:18:59 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-09-20 04:18:59 -0700
commit834ae7f12afa0d4350e3874a135aa5a4c24a87d7 (patch)
tree59478adff11dc8cd1aa0654dc5475a8216b29e80 /drivers/input/evdev.c
parent4f3a1d592e8dc6d7327fc7ca915b9b764883d5b7 (diff)
parent24a2d11aa804699923077b0e13d1b65e36217db0 (diff)
Merge bk://kernel.bkbits.net/gregkh/linux/linus-2.6
into home.osdl.org:/home/torvalds/v2.5/linux
Diffstat (limited to 'drivers/input/evdev.c')
-rw-r--r--drivers/input/evdev.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
index 10a13ac90c48..ca56ac39e2b8 100644
--- a/drivers/input/evdev.c
+++ b/drivers/input/evdev.c
@@ -208,7 +208,7 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
struct evdev *evdev = list->evdev;
struct input_dev *dev = evdev->handle.dev;
struct input_absinfo abs;
- int i, t, u;
+ int i, t, u, v;
if (!evdev->exist) return -ENODEV;
@@ -239,14 +239,12 @@ static int evdev_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
case EVIOCSKEYCODE:
if (get_user(t, ((int *) arg) + 0)) return -EFAULT;
if (t < 0 || t > dev->keycodemax || !dev->keycodesize) return -EINVAL;
+ if (get_user(v, ((int *) arg) + 1)) return -EFAULT;
u = INPUT_KEYCODE(dev, t);
- if (get_user(INPUT_KEYCODE(dev, t), ((int *) arg) + 1)) return -EFAULT;
-
- for (i = 0; i < dev->keycodemax; i++)
- if(INPUT_KEYCODE(dev, t) == u) break;
+ INPUT_KEYCODE(dev, t) = v;
+ for (i = 0; i < dev->keycodemax; i++) if (v == u) break;
if (i == dev->keycodemax) clear_bit(u, dev->keybit);
- set_bit(INPUT_KEYCODE(dev, t), dev->keybit);
-
+ set_bit(v, dev->keybit);
return 0;
case EVIOCSFF: