From 6dea93477c3377cf4199fd37cc3fb11071987ae4 Mon Sep 17 00:00:00 2001 From: Ben Collins Date: Tue, 31 Jan 2006 01:31:13 -0500 Subject: Input: hiddev - fix off-by-one for num_values in uref_multi requests Found this when working with a HAPP UGCI device. It has a usage with 7 indexes. I could read them all one at a time, but using a multiref it would only allow me to read the first 6. The patch below fixed it. Signed-off-by: Ben Collins Signed-off-by: Dmitry Torokhov --- drivers/usb/input/hiddev.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/usb/input/hiddev.c') diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c index 4dff8473553d..3f7274906c13 100644 --- a/drivers/usb/input/hiddev.c +++ b/drivers/usb/input/hiddev.c @@ -632,7 +632,7 @@ static int hiddev_ioctl(struct inode *inode, struct file *file, unsigned int cmd else if ((cmd == HIDIOCGUSAGES || cmd == HIDIOCSUSAGES) && (uref_multi->num_values > HID_MAX_MULTI_USAGES || - uref->usage_index + uref_multi->num_values >= field->report_count)) + uref->usage_index + uref_multi->num_values > field->report_count)) goto inval; } -- cgit v1.2.3 From 595b14cbccb2f9122bccfa6b55f2d9a380e9adeb Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Wed, 18 Jan 2006 17:36:58 -0500 Subject: [PATCH] USB: remove some left over devfs droppings hanging around in the usb drivers As there is no more usb devfs support, these bits would just confuse people. Signed-off-by: Greg Kroah-Hartman --- drivers/usb/input/hiddev.c | 3 --- drivers/usb/misc/ldusb.c | 2 +- drivers/usb/usb-skeleton.c | 2 +- 3 files changed, 2 insertions(+), 5 deletions(-) (limited to 'drivers/usb/input/hiddev.c') diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c index 4dff8473553d..77be6b9a820f 100644 --- a/drivers/usb/input/hiddev.c +++ b/drivers/usb/input/hiddev.c @@ -35,7 +35,6 @@ #include #include "hid.h" #include -#include #ifdef CONFIG_USB_DYNAMIC_MINORS #define HIDDEV_MINOR_BASE 0 @@ -832,12 +831,10 @@ static /* const */ struct usb_driver hiddev_driver = { int __init hiddev_init(void) { - devfs_mk_dir("usb/hid"); return usb_register(&hiddev_driver); } void hiddev_exit(void) { usb_deregister(&hiddev_driver); - devfs_remove("usb/hid"); } diff --git a/drivers/usb/misc/ldusb.c b/drivers/usb/misc/ldusb.c index 981d8a5fbfd9..331d4ae949ed 100644 --- a/drivers/usb/misc/ldusb.c +++ b/drivers/usb/misc/ldusb.c @@ -593,7 +593,7 @@ static struct file_operations ld_usb_fops = { /* * usb class driver info in order to get a minor number from the usb core, - * and to have the device registered with devfs and the driver core + * and to have the device registered with the driver core */ static struct usb_class_driver ld_usb_class = { .name = "ldusb%d", diff --git a/drivers/usb/usb-skeleton.c b/drivers/usb/usb-skeleton.c index 5d02f16b7d0e..4de9fb56ebfc 100644 --- a/drivers/usb/usb-skeleton.c +++ b/drivers/usb/usb-skeleton.c @@ -234,7 +234,7 @@ static struct file_operations skel_fops = { /* * usb class driver info in order to get a minor number from the usb core, - * and to have the device registered with devfs and the driver core + * and to have the device registered with the driver core */ static struct usb_class_driver skel_class = { .name = "skel%d", -- cgit v1.2.3