Skip to content

Commit

Permalink
[usb netdev] asix: fix regression
Browse files Browse the repository at this point in the history
51bf297 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>
  • Loading branch information
Russ Dill authored and Jeff Garzik committed Jan 12, 2008
1 parent cadf185 commit 94d4336
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/net/usb/asix.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 94d4336

Please sign in to comment.