From: Orjan Friberg Date: Wed, 9 Aug 2006 06:31:40 +0000 (-0700) Subject: USB: usbtest.c: unsigned retval makes ctrl_out return 0 in case of error X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=f54fa84dda211f68f65002efa44142207c886c79;p=linux-beck.git USB: usbtest.c: unsigned retval makes ctrl_out return 0 in case of error In my quest to try and figure out why test 14 (control write) doesn't work with my EZ-USB board, I noticed that sometimes testusb reported no error even though the kernel log complained "byte 0 is 0 not 2" etc. Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c index 786e1dbe88ec..983e104dd452 100644 --- a/drivers/usb/misc/usbtest.c +++ b/drivers/usb/misc/usbtest.c @@ -1242,11 +1242,12 @@ done: static int ctrl_out (struct usbtest_dev *dev, unsigned count, unsigned length, unsigned vary) { - unsigned i, j, len, retval; + unsigned i, j, len; + int retval; u8 *buf; char *what = "?"; struct usb_device *udev; - + if (length < 1 || length > 0xffff || vary >= length) return -EINVAL;