提交 94d43363 编写于 作者: R Russ Dill 提交者: 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: NRuss Dill <Russ.Dill@gmail.com>
Signed-off-by: NJeff Garzik <jeff@garzik.org>
上级 cadf1855
......@@ -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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册