From: Russ Dill Date: Thu, 10 Jan 2008 04:32:07 +0000 (-0700) Subject: [usb netdev] asix: fix regression X-Git-Tag: v2.6.24-rc8~34^2~5 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=94d433630a1e63d383d592d488f60581e0d98190;p=linux-2.6-omap-h63xx.git [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 Signed-off-by: Jeff Garzik --- diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c index 1249f444039..569028b2baf 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, 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: