lkml.org 
[lkml]   [2006]   [Jan]   [31]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
FromDmitry Torokhov <>
SubjectRe: [PATCH 2.6.15/2.6.16-git] Fix off-by-one for num_values in uref multi requests
DateTue, 31 Jan 2006 01:32:02 -0500
On Monday 30 January 2006 11:24, Ben Collins wrote:
> 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>
>

I applied this to the input tree, thanks!

> --- a/drivers/usb/input/hiddev.c
> +++ b/drivers/usb/input/hiddev.c
> @@ -632,7 +632,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;
>  			}
> 
> 

-- 
Dmitry
-
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-01-31 07:34    [from the cache]
©2003-2008