]> nv-tegra.nvidia Code Review - linux-2.6.git/commitdiff
USB: usbtest.c: unsigned retval makes ctrl_out return 0 in case of error
authorOrjan Friberg <orjan.friberg@axis.com>
Wed, 9 Aug 2006 06:31:40 +0000 (23:31 -0700)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 11 Aug 2006 21:06:06 +0000 (14:06 -0700)
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 <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/misc/usbtest.c

index 786e1dbe88ec4dbbd82484146ad77fa6d7444473..983e104dd4520653baa6f61c4ca2ccff10a16ba5 100644 (file)
@@ -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;