Update of /cvsroot/linuxconsole/ruby/linux/drivers/input
In directory usw-pr-cvs1:/tmp/cvs-serv18770
Modified Files:
evdev.c
Log Message:
Return -EFAULT instead -EINVAL when provided with bad addresses.
Index: evdev.c
===================================================================
RCS file: /cvsroot/linuxconsole/ruby/linux/drivers/input/evdev.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- evdev.c 20 Mar 2002 21:43:25 -0000 1.47
+++ evdev.c 26 May 2002 14:28:26 -0000 1.48
@@ -289,11 +289,11 @@
int err;
if (copy_from_user((void*)(&effect), (void*)arg, sizeof(effect))) {
- return -EINVAL;
+ return -EFAULT;
}
err = dev->upload_effect(dev, &effect);
if (put_user(effect.id, &(((struct ff_effect*)arg)->id))) {
- return -EINVAL;
+ return -EFAULT;
}
return err;
}
@@ -306,7 +306,8 @@
else return -ENOSYS;
case EVIOCGEFFECTS:
- put_user(dev->ff_effects_max, (int*) arg);
+ if (retval = put_user(dev->ff_effects_max, (int*) arg))
+ return retval;
return 0;
default:
|