* [PATCH net-next-2.6] cx82310_eth: check usb_string() return value for error
@ 2010-09-11 15:39 Ondrej Zary
2010-09-14 3:04 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Ondrej Zary @ 2010-09-11 15:39 UTC (permalink / raw)
To: David Miller; +Cc: netdev, Kernel development list
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
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH net-next-2.6] cx82310_eth: check usb_string() return value for error
2010-09-11 15:39 [PATCH net-next-2.6] cx82310_eth: check usb_string() return value for error Ondrej Zary
@ 2010-09-14 3:04 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2010-09-14 3:04 UTC (permalink / raw)
To: linux; +Cc: netdev, linux-kernel
From: Ondrej Zary <linux@rainbow-software.org>
Date: Sat, 11 Sep 2010 17:39:57 +0200
> 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>
Applied.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-09-14 3:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-11 15:39 [PATCH net-next-2.6] cx82310_eth: check usb_string() return value for error Ondrej Zary
2010-09-14 3:04 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.