RFC/patch 4/6: usb: fix string collection for unauth devices

Inaky Perez-Gonzalez <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization Intel Corporation
Message-ID <[email protected]>
# HG changeset patch
# User Inaky Perez-Gonzalez <[email protected]>
# Date 1177452430 25200
# Node ID 4a813201f50ac479b26852a2591588e2260e7a9d
# Parent  ea995fd510552dfce57a0283205277950655024b
usb: fix string collection for unauth devices

diff -r ea995fd51055 -r 4a813201f50a drivers/usb/core/hub.c
--- a/drivers/usb/core/hub.c	Tue Apr 24 13:06:10 2007 -0700
+++ b/drivers/usb/core/hub.c	Tue Apr 24 15:07:10 2007 -0700
@@ -1295,16 +1295,16 @@ int usb_new_device(struct usb_device *ud
 	}
 
 	if (udev->wusb == 1 && udev->authorized == 0) {
+		udev->product = kstrdup("n/a (unauthorized)", GFP_KERNEL);
+		udev->manufacturer = kstrdup("n/a (unauthorized)", GFP_KERNEL);
+		udev->serial = kstrdup("n/a (unauthorized)", GFP_KERNEL);
+	}
+	else {
 		/* read the standard strings and cache them if present */
 		udev->product = usb_cache_string(udev, udev->descriptor.iProduct);
 		udev->manufacturer = usb_cache_string(udev,
 						      udev->descriptor.iManufacturer);
 		udev->serial = usb_cache_string(udev, udev->descriptor.iSerialNumber);		
-	}
-	else {
-		udev->product = kstrdup("n/a (unauthorized)\n", GFP_KERNEL);
-		udev->manufacturer = kstrdup("n/a (unauthorized)\n", GFP_KERNEL);
-		udev->serial = kstrdup("n/a (unauthorized)\n", GFP_KERNEL);
 	}
 	/* Tell the world! */
 	dev_dbg(&udev->dev, "new device strings: Mfr=%d, Product=%d, "

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.