patch-2.3.39 linux/drivers/usb/usb-debug.c

Next file: linux/drivers/usb/usb.c
Previous file: linux/drivers/usb/usb-core.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.38/linux/drivers/usb/usb-debug.c linux/drivers/usb/usb-debug.c
@@ -6,6 +6,7 @@
  */
 #include <linux/version.h>
 #include <linux/kernel.h>
+#include <linux/slab.h>
 
 #define DEBUG
 
@@ -175,9 +176,12 @@
 
 void usb_show_string(struct usb_device *dev, char *id, int index)
 {
-	char *p = usb_string(dev, index);
+	char *buf;
 
-	if (p != 0)
-		printk(KERN_INFO "%s: %s\n", id, p);
+	if (!(buf = kmalloc(256, GFP_KERNEL)))
+		return;
+	if (usb_string(dev, index, buf, 256) > 0)
+		printk(KERN_INFO "%s: %s\n", id, buf);
+	kfree(buf);
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)