Skip to contentSkip to conversation

Fix 2.6.24-rc7 regression in asix.c

PATCH New Russ Dill 1 participant 1 message Jan 8, 2008

Subsystems (2)
lore
Share & tools
lore

Russ Dill

author
#0 lore raw

PATCH 1/1 Fix 2.6.24-rc7 regression in asix.c

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.

---
 drivers/net/usb/asix.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/usb/asix.c +3 -3
index 1249f44..569028b 100644
@@ -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:
Signature · 1 line
1.5.3.7