* [PATCH] Fix 2.6.24-rc7 regression in asix.c
@ 2008-01-08 22:17 Russ Dill
0 siblings, 0 replies; only message in thread
From: Russ Dill @ 2008-01-08 22:17 UTC (permalink / raw)
To: linux-kernel; +Cc: linux-net
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.
Signed-off-by: Russ Dill <Russ.Dill@gmail.com>
---
drivers/net/usb/asix.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
index 1249f44..569028b 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:
--
1.5.3.7
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2008-01-08 22:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-01-08 22:17 [PATCH] Fix 2.6.24-rc7 regression in asix.c Russ Dill
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®