From: Ondrej Zary <linux@rainbow-software.org>
To: David Miller <davem@davemloft.net>
Cc: netdev@vger.kernel.org,
Kernel development list <linux-kernel@vger.kernel.org>
Subject: [PATCH net-next-2.6] cx82310_eth: check usb_string() return value for error
Date: Sat, 11 Sep 2010 17:39:57 +0200 [thread overview]
Message-ID: <201009111740.00243.linux@rainbow-software.org> (raw)
Fix that usb_string() return value is not checked for error (negative value).
Also change the ignore message a bit and lower its level to info.
Signed-off-by: Ondrej Zary <linux@rainbow-software.org>
--- linux-2.6.36-rc3-/drivers/net/usb/cx82310_eth.c 2010-09-11 17:06:59.000000000 +0200
+++ linux-2.6.36-rc3/drivers/net/usb/cx82310_eth.c 2010-09-11 17:21:22.000000000 +0200
@@ -138,11 +138,9 @@ static int cx82310_bind(struct usbnet *d
struct usb_device *udev = dev->udev;
/* avoid ADSL modems - continue only if iProduct is "USB NET CARD" */
- if (udev->descriptor.iProduct &&
- usb_string(udev, udev->descriptor.iProduct, buf, sizeof(buf)) &&
- strcmp(buf, "USB NET CARD")) {
- dev_err(&udev->dev,
- "probably an ADSL modem, use cxacru driver instead\n");
+ if (usb_string(udev, udev->descriptor.iProduct, buf, sizeof(buf)) > 0
+ && strcmp(buf, "USB NET CARD")) {
+ dev_info(&udev->dev, "ignoring: probably an ADSL modem\n");
return -ENODEV;
}
--
Ondrej Zary
next reply other threads:[~2010-09-11 15:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-11 15:39 Ondrej Zary [this message]
2010-09-14 3:04 ` [PATCH net-next-2.6] cx82310_eth: check usb_string() return value for error David Miller
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=201009111740.00243.linux@rainbow-software.org \
--to=linux@rainbow-software.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.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;
as well as URLs for NNTP newsgroup(s).