Skip to content

Commit 47a4b71

Browse files
committed
Merge tag 'usb-serial-4.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus
Johan writes: USB-serial fixes for v4.14-rc5 Here's a fix for a cp210x regression that prevented a class of devices from being successfully probed. Two use-after-free bugs in the console code are also fixed. Included are also some new device ids. All but the last three commits have been in linux-next with no reported issues.
2 parents 8a5776a + 299d757 commit 47a4b71

File tree

6 files changed

+24
-7
lines changed

6 files changed

+24
-7
lines changed

drivers/usb/serial/console.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ static int usb_console_setup(struct console *co, char *options)
186186
tty_kref_put(tty);
187187
reset_open_count:
188188
port->port.count = 0;
189+
info->port = NULL;
189190
usb_autopm_put_interface(serial->interface);
190191
error_get_interface:
191192
usb_serial_put(serial);
@@ -265,7 +266,7 @@ static struct console usbcons = {
265266

266267
void usb_serial_console_disconnect(struct usb_serial *serial)
267268
{
268-
if (serial->port[0] == usbcons_info.port) {
269+
if (serial->port[0] && serial->port[0] == usbcons_info.port) {
269270
usb_serial_console_exit();
270271
usb_serial_put(serial);
271272
}

drivers/usb/serial/cp210x.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ static const struct usb_device_id id_table[] = {
177177
{ USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
178178
{ USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
179179
{ USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */
180+
{ USB_DEVICE(0x18EF, 0xE032) }, /* ELV TFD500 Data Logger */
180181
{ USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */
181182
{ USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */
182183
{ USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */
@@ -352,6 +353,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
352353
#define CP210X_PARTNUM_CP2104 0x04
353354
#define CP210X_PARTNUM_CP2105 0x05
354355
#define CP210X_PARTNUM_CP2108 0x08
356+
#define CP210X_PARTNUM_UNKNOWN 0xFF
355357

356358
/* CP210X_GET_COMM_STATUS returns these 0x13 bytes */
357359
struct cp210x_comm_status {
@@ -1491,8 +1493,11 @@ static int cp210x_attach(struct usb_serial *serial)
14911493
result = cp210x_read_vendor_block(serial, REQTYPE_DEVICE_TO_HOST,
14921494
CP210X_GET_PARTNUM, &priv->partnum,
14931495
sizeof(priv->partnum));
1494-
if (result < 0)
1495-
goto err_free_priv;
1496+
if (result < 0) {
1497+
dev_warn(&serial->interface->dev,
1498+
"querying part number failed\n");
1499+
priv->partnum = CP210X_PARTNUM_UNKNOWN;
1500+
}
14961501

14971502
usb_set_serial_data(serial, priv);
14981503

@@ -1505,10 +1510,6 @@ static int cp210x_attach(struct usb_serial *serial)
15051510
}
15061511

15071512
return 0;
1508-
err_free_priv:
1509-
kfree(priv);
1510-
1511-
return result;
15121513
}
15131514

15141515
static void cp210x_disconnect(struct usb_serial *serial)

drivers/usb/serial/ftdi_sio.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,6 +1015,8 @@ static const struct usb_device_id id_table_combined[] = {
10151015
{ USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) },
10161016
{ USB_DEVICE(TI_VID, TI_CC3200_LAUNCHPAD_PID),
10171017
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1018+
{ USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_BT_USB_PID) },
1019+
{ USB_DEVICE(CYPRESS_VID, CYPRESS_WICED_WL_USB_PID) },
10181020
{ } /* Terminating entry */
10191021
};
10201022

drivers/usb/serial/ftdi_sio_ids.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,13 @@
609609
#define ADI_GNICE_PID 0xF000
610610
#define ADI_GNICEPLUS_PID 0xF001
611611

612+
/*
613+
* Cypress WICED USB UART
614+
*/
615+
#define CYPRESS_VID 0x04B4
616+
#define CYPRESS_WICED_BT_USB_PID 0x009B
617+
#define CYPRESS_WICED_WL_USB_PID 0xF900
618+
612619
/*
613620
* Microchip Technology, Inc.
614621
*

drivers/usb/serial/option.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -522,6 +522,7 @@ static void option_instat_callback(struct urb *urb);
522522

523523
/* TP-LINK Incorporated products */
524524
#define TPLINK_VENDOR_ID 0x2357
525+
#define TPLINK_PRODUCT_LTE 0x000D
525526
#define TPLINK_PRODUCT_MA180 0x0201
526527

527528
/* Changhong products */
@@ -2011,6 +2012,7 @@ static const struct usb_device_id option_ids[] = {
20112012
{ USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
20122013
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) },
20132014
{ USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) },
2015+
{ USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, TPLINK_PRODUCT_LTE, 0xff, 0x00, 0x00) }, /* TP-Link LTE Module */
20142016
{ USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180),
20152017
.driver_info = (kernel_ulong_t)&net_intf4_blacklist },
20162018
{ USB_DEVICE(TPLINK_VENDOR_ID, 0x9000), /* TP-Link MA260 */

drivers/usb/serial/qcserial.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ static const struct usb_device_id id_table[] = {
174174
{DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
175175
{DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */
176176
{DEVICE_SWI(0x413c, 0x81b6)}, /* Dell Wireless 5811e QDL */
177+
{DEVICE_SWI(0x413c, 0x81cf)}, /* Dell Wireless 5819 */
178+
{DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */
179+
{DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */
180+
{DEVICE_SWI(0x413c, 0x81d2)}, /* Dell Wireless 5818 */
177181

178182
/* Huawei devices */
179183
{DEVICE_HWI(0x03f0, 0x581d)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */

0 commit comments

Comments
 (0)