cx82310_eth: check usb_string() return value for error
authorOndrej Zary <linux@rainbow-software.org>
Sat, 11 Sep 2010 05:39:57 +0000 (05:39 +0000)
committerDavid S. Miller <davem@davemloft.net>
Tue, 14 Sep 2010 03:02:52 +0000 (20:02 -0700)
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>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/usb/cx82310_eth.c

index 6fbe032..4d45178 100644 (file)
@@ -138,11 +138,9 @@ static int cx82310_bind(struct usbnet *dev, struct usb_interface *intf)
        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;
        }