lkml.org 
[lkml]   [2006]   [Feb]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[GIT PATCH 18/18] hiddev: fix off-by-one for num_values in uref_multi requests
From: Ben Collins <bcollins@ubuntu.com>

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>
---

drivers/usb/input/hiddev.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)

Index: work/drivers/usb/input/hiddev.c
===================================================================
--- work.orig/drivers/usb/input/hiddev.c
+++ work/drivers/usb/input/hiddev.c
@@ -631,7 +631,7 @@ static int hiddev_ioctl(struct inode *in

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;
}

-
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/

\
 
 \ /
  Last update: 2006-02-01 06:15    [W:0.071 / U:2.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site