summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 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: