Skip to content

Commit

Permalink
USB: usbtest.c: length, sglen and vary are unsigned, so cannot be neg…
Browse files Browse the repository at this point in the history
…ative

length, sglen and vary are unsigned, so cannot be negative

see
vi drivers/usb/misc/usbtest.c +18
struct usbtest_param {
...
        unsigned                iterations;
        unsigned                length;
        unsigned                vary;
        unsigned                sglen;
...
};

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
roel kluin authored and Greg Kroah-Hartman committed Oct 22, 2008
1 parent 1460e5e commit 8aafdf6
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/usb/misc/usbtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -1561,8 +1561,7 @@ usbtest_ioctl (struct usb_interface *intf, unsigned int code, void *buf)
if (code != USBTEST_REQUEST)
return -EOPNOTSUPP;

if (param->iterations <= 0 || param->length < 0
|| param->sglen < 0 || param->vary < 0)
if (param->iterations <= 0)
return -EINVAL;

if (mutex_lock_interruptible(&dev->lock))
Expand Down

0 comments on commit 8aafdf6

Please sign in to comment.