Commit 94d43363 authored by Russ Dill's avatar Russ Dill Committed by Jeff Garzik

[usb netdev] asix: fix regression

51bf2976 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: default avatarRuss Dill <Russ.Dill@gmail.com>
Signed-off-by: default avatarJeff Garzik <jeff@garzik.org>
parent cadf1855
...@@ -202,10 +202,10 @@ static int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index, ...@@ -202,10 +202,10 @@ static int asix_read_cmd(struct usbnet *dev, u8 cmd, u16 value, u16 index,
buf, buf,
size, size,
USB_CTRL_GET_TIMEOUT); USB_CTRL_GET_TIMEOUT);
if (err >= 0 && err < size) if (err == size)
err = -EINVAL;
if (!err)
memcpy(data, buf, size); memcpy(data, buf, size);
else if (err >= 0)
err = -EINVAL;
kfree(buf); kfree(buf);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment