Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: usbtest.c: length, sglen and vary are unsigned, so cannot be negative

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>

authored by

roel kluin and committed by
Greg Kroah-Hartman
8aafdf6a 1460e5e4

+1 -2
+1 -2
drivers/usb/misc/usbtest.c
··· 1561 1561 if (code != USBTEST_REQUEST) 1562 1562 return -EOPNOTSUPP; 1563 1563 1564 - if (param->iterations <= 0 || param->length < 0 1565 - || param->sglen < 0 || param->vary < 0) 1564 + if (param->iterations <= 0) 1566 1565 return -EINVAL; 1567 1566 1568 1567 if (mutex_lock_interruptible(&dev->lock))