Skip to contentSkip to conversation

cx82310_eth: check usb_string() return value for error

PATCH Applied Ondrej Zary 2 participants 2 messages Sep 11, 2010 – Sep 14, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cx82310_eth: check usb_string() return value for error

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.

drivers/net/usb/cx82310_eth.c +3 -5
@@ -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;
 	}
 
Signature · 1 line
Ondrej Zary
maintainer Applied
#1 lore raw

From: Ondrej Zary <[email protected]>
Date: Sat, 11 Sep 2010 17:39:57 +0200

Quoted 4 lines

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.

Applied.