aboutsummaryrefslogtreecommitdiff
path: root/drivers/usb
diff options
context:
space:
mode:
authorBen Collins <bcollins@ubuntu.com>2006-01-31 01:31:13 -0500
committerDmitry Torokhov <dtor_core@ameritech.net>2006-01-31 01:31:13 -0500
commit6dea93477c3377cf4199fd37cc3fb11071987ae4 (patch)
tree33190c4ab5f6e9ec539c90c8cf4d0f3d96e62449 /drivers/usb
parent97d4ebfe7946bc9b89791c932a15c990a24aa94d (diff)
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 <bcollins@ubuntu.com> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/input/hiddev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/input/hiddev.c b/drivers/usb/input/hiddev.c
index 4dff8473553..3f7274906c1 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;
}