mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 21:54:11 +08:00
[usb netdev] asix: fix regression
51bf2976b5
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>
This commit is contained in:
parent
cadf1855e9
commit
94d433630a
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user