mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Russ Dill <russ.dill@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: linux-net@vget.kernel.org
Subject: [PATCH] Fix 2.6.24-rc7 regression in asix.c
Date: Tue, 08 Jan 2008 15:17:27 -0700	[thread overview]
Message-ID: <1199830647.30986.1.camel@russ-laptop> (raw)

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




                 reply	other threads:[~2008-01-08 22:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1199830647.30986.1.camel@russ-laptop \
    --to=russ.dill@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-net@vget.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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®