]> err.no Git - linux-2.6/commitdiff
[usb netdev] asix: fix regression
authorRuss Dill <Russ.Dill@asu.edu>
Thu, 10 Jan 2008 04:32:07 +0000 (21:32 -0700)
committerJeff Garzik <jeff@garzik.org>
Sat, 12 Jan 2008 22:43:19 +0000 (17:43 -0500)
51bf2976b55d07f9daae9697a0a3ac9f58abcedc caused a regression in the asix
usbnet driver. usb_control_msg returns the number of bytes read on
success, not 0. Tested with NETGEAR FA120.

Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/usb/asix.c

index 1249f444039e5492883ef42d18cf0bbd73181d3d..569028b2baf2d8930a21bca17b775c764f793c39 100644 (file)
@@ -202,10 +202,10 @@ static int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
                buf,
                size,
                USB_CTRL_GET_TIMEOUT);
-       if (err >= 0 && err < size)
-               err = -EINVAL;
-       if (!err)
+       if (err == size)
                memcpy(data, buf, size);
+       else if (err >= 0)
+               err = -EINVAL;
        kfree(buf);
 
 out: