On Sun, Feb 28, 2016 at 08:14:39PM +0100, Stefan Kempf wrote:
> This changes uiomovei calls to uiomove in usb. It fixes
> a few integer truncations due to use of min, and uses
> unsigned types for count variables where it makes sense.
> This also allows us to get rid of a couple of 'if (len < 0)' checks
> that just cannot happen.

Yes, UGETW() returns u_int16_t. Nice catch!


> --- dev/usb//usb.c    22 Jan 2016 13:31:47 -0000      1.109
> +++ dev/usb//usb.c    28 Feb 2016 19:10:07 -0000
> @@ -766,7 +766,8 @@ usbioctl(dev_t devt, u_long cmd, caddr_t
>               usb_config_descriptor_t *cdesc;
>               struct iovec iov;
>               struct uio uio;
> -             int len, error;
> +             int error;
> +             size_t len;

I think this should be (ordered by storage size):

        size_t len;
        int error;


> ok?
ok natano@

Reply via email to