aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRuss Dill <Russ.Dill@asu.edu>2008-01-09 23:32:07 -0500
committerJeff Garzik <jeff@garzik.org>2008-01-12 17:43:19 -0500
commit94d433630a1e63d383d592d488f60581e0d98190 (patch)
tree64807d68c7c13b2a4ce3515b5bba8377e3d422bc
parentcadf1855e9f97d3f6857a168e1e7798fe27530a1 (diff)
[usb netdev] asix: fix regression
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>
-rw-r--r--drivers/net/usb/asix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 1249f444039e..569028b2baf2 100644
--- a/drivers/net/usb/asix.c
+++ b/drivers/net/usb/asix.c
@@ -202,10 +202,10 @@ static int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
202 buf, 202 buf,
203 size, 203 size,
204 USB_CTRL_GET_TIMEOUT); 204 USB_CTRL_GET_TIMEOUT);
205 if (err >= 0 && err < size) 205 if (err == size)
206 err = -EINVAL;
207 if (!err)
208 memcpy(data, buf, size); 206 memcpy(data, buf, size);
207 else if (err >= 0)
208 err = -EINVAL;
209 kfree(buf); 209 kfree(buf);
210 210
211out: 211out: