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 <Russ.Dill@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
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: