Hi,

This patch adds a new device ID to the cp2101 driver, and also fixes a
bug identified by Eric Enright:
> On line 168 it kmalloc()s some memory, memset()s
> it, and /then/ checks to see if kmalloc() returned a valid pointer. 
> The memset() and NULL check should probably be switched around.

-- 
Signed-off-by: Craig Shelley <[EMAIL PROTECTED]>
diff -Nru a/drivers/usb/serial/cp2101.c b/drivers/usb/serial/cp2101.c
--- a/drivers/usb/serial/cp2101.c	2006-03-11 11:10:42.546446750 +0000
+++ b/drivers/usb/serial/cp2101.c	2006-03-11 11:17:26.851714250 +0000
@@ -32,7 +32,7 @@
 /*
  * Version Information
  */
-#define DRIVER_VERSION "v0.06"
+#define DRIVER_VERSION "v0.07"
 #define DRIVER_DESC "Silicon Labs CP2101/CP2102 RS232 serial adaptor driver"
 
 /*
@@ -57,6 +57,7 @@
 	{ USB_DEVICE(0x0FCF, 0x1003) }, /* Dynastream ANT development board */
 	{ USB_DEVICE(0x10B5, 0xAC70) }, /* Nokia CA-42 USB */
 	{ USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */
+	{ USB_DEVICE(0x10C4, 0x803B) }, /* Pololu USB-serial converter */
 	{ USB_DEVICE(0x10C4, 0x807A) }, /* Crumb128 board */
 	{ USB_DEVICE(0x10C4, 0x80CA) }, /* Degree Controls Inc */
 	{ USB_DEVICE(0x10C4, 0x80F6) }, /* Suunto sports instrument */
@@ -167,13 +168,13 @@
 	length = (((size - 1) | 3) + 1)/4;
 
 	buf = kmalloc (length * sizeof(u32), GFP_KERNEL);
-	memset(buf, 0, length * sizeof(u32));
-
 	if (!buf) {
 		dev_err(&port->dev, "%s - out of memory.\n", __FUNCTION__);
 		return -ENOMEM;
 	}
 
+	memset(buf, 0, length * sizeof(u32));
+
 	/* For get requests, the request number must be incremented */
 	request++;
 

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to