aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 07:20:30 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-10-09 07:20:30 -0400
commit47a4b71c0b15be08a0f5e3011e71551a269bbe59 (patch)
tree9f924e759ffc03a7c2447ac95100e7284b052f53
parent8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff)
parent299d7572e46f98534033a9e65973f13ad1ce9047 (diff)
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.
-rw-r--r--drivers/usb/serial/console.c3
-rw-r--r--drivers/usb/serial/cp210x.c13
-rw-r--r--drivers/usb/serial/ftdi_sio.c2
-rw-r--r--drivers/usb/serial/ftdi_sio_ids.h7
-rw-r--r--drivers/usb/serial/option.c2
-rw-r--r--drivers/usb/serial/qcserial.c4
6 files changed, 24 insertions, 7 deletions
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index fdf89800ebc3..43a862a90a77 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -186,6 +186,7 @@ static int usb_console_setup(struct console *co, char *options)
186 tty_kref_put(tty); 186 tty_kref_put(tty);
187 reset_open_count: 187 reset_open_count:
188 port->port.count = 0; 188 port->port.count = 0;
189 info->port = NULL;
189 usb_autopm_put_interface(serial->interface); 190 usb_autopm_put_interface(serial->interface);
190 error_get_interface: 191 error_get_interface:
191 usb_serial_put(serial); 192 usb_serial_put(serial);
@@ -265,7 +266,7 @@ static struct console usbcons = {
265 266
266void usb_serial_console_disconnect(struct usb_serial *serial) 267void usb_serial_console_disconnect(struct usb_serial *serial)
267{ 268{
268 if (serial->port[0] == usbcons_info.port) { 269 if (serial->port[0] && serial->port[0] == usbcons_info.port) {
269 usb_serial_console_exit(); 270 usb_serial_console_exit();
270 usb_serial_put(serial); 271 usb_serial_put(serial);
271 } 272 }
diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
index 2d945c9f975c..412f812522ee 100644
--- a/drivers/usb/serial/cp210x.c
+++ b/drivers/usb/serial/cp210x.c
@@ -177,6 +177,7 @@ static const struct usb_device_id id_table[] = {
177 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ 177 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
178 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ 178 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
179 { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */ 179 { USB_DEVICE(0x18EF, 0xE025) }, /* ELV Marble Sound Board 1 */
180 { USB_DEVICE(0x18EF, 0xE032) }, /* ELV TFD500 Data Logger */
180 { USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */ 181 { USB_DEVICE(0x1901, 0x0190) }, /* GE B850 CP2105 Recorder interface */
181 { USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */ 182 { USB_DEVICE(0x1901, 0x0193) }, /* GE B650 CP2104 PMC interface */
182 { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */ 183 { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */
@@ -352,6 +353,7 @@ static struct usb_serial_driver * const serial_drivers[] = {
352#define CP210X_PARTNUM_CP2104 0x04 353#define CP210X_PARTNUM_CP2104 0x04
353#define CP210X_PARTNUM_CP2105 0x05 354#define CP210X_PARTNUM_CP2105 0x05
354#define CP210X_PARTNUM_CP2108 0x08 355#define CP210X_PARTNUM_CP2108 0x08
356#define CP210X_PARTNUM_UNKNOWN 0xFF
355 357
356/* CP210X_GET_COMM_STATUS returns these 0x13 bytes */ 358/* CP210X_GET_COMM_STATUS returns these 0x13 bytes */
357struct cp210x_comm_status { 359struct cp210x_comm_status {
@@ -1491,8 +1493,11 @@ static int cp210x_attach(struct usb_serial *serial)
1491 result = cp210x_read_vendor_block(serial, REQTYPE_DEVICE_TO_HOST, 1493 result = cp210x_read_vendor_block(serial, REQTYPE_DEVICE_TO_HOST,
1492 CP210X_GET_PARTNUM, &priv->partnum, 1494 CP210X_GET_PARTNUM, &priv->partnum,
1493 sizeof(priv->partnum)); 1495 sizeof(priv->partnum));
1494 if (result < 0) 1496 if (result < 0) {
1495 goto err_free_priv; 1497 dev_warn(&serial->interface->dev,
1498 "querying part number failed\n");
1499 priv->partnum = CP210X_PARTNUM_UNKNOWN;
1500 }
1496 1501
1497 usb_set_serial_data(serial, priv); 1502 usb_set_serial_data(serial, priv);
1498 1503
@@ -1505,10 +1510,6 @@ static int cp210x_attach(struct usb_serial *serial)
1505 } 1510 }
1506 1511
1507 return 0; 1512 return 0;
1508err_free_priv:
1509 kfree(priv);
1510
1511 return result;
1512} 1513}
1513 1514
1514static void cp210x_disconnect(struct usb_serial *serial) 1515static void cp210x_disconnect(struct usb_serial *serial)
diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
index 1cec03799cdf..49d1b2d4606d 100644
--- a/drivers/usb/serial/ftdi_sio.c
+++ b/drivers/usb/serial/ftdi_sio.c
@@ -1015,6 +1015,8 @@ static const struct usb_device_id id_table_combined[] = {
1015 { USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) }, 1015 { USB_DEVICE(WICED_VID, WICED_USB20706V2_PID) },
1016 { USB_DEVICE(TI_VID, TI_CC3200_LAUNCHPAD_PID), 1016 { USB_DEVICE(TI_VID, TI_CC3200_LAUNCHPAD_PID),
1017 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk }, 1017 .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) },
1018 { } /* Terminating entry */ 1020 { } /* Terminating entry */
1019}; 1021};
1020 1022
diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
index 4fcf1cecb6d7..f9d15bd62785 100644
--- a/drivers/usb/serial/ftdi_sio_ids.h
+++ b/drivers/usb/serial/ftdi_sio_ids.h
@@ -610,6 +610,13 @@
610#define ADI_GNICEPLUS_PID 0xF001 610#define ADI_GNICEPLUS_PID 0xF001
611 611
612/* 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
619/*
613 * Microchip Technology, Inc. 620 * Microchip Technology, Inc.
614 * 621 *
615 * MICROCHIP_VID (0x04D8) and MICROCHIP_USB_BOARD_PID (0x000A) are 622 * MICROCHIP_VID (0x04D8) and MICROCHIP_USB_BOARD_PID (0x000A) are
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
index 54bfef13966a..ba672cf4e888 100644
--- a/drivers/usb/serial/option.c
+++ b/drivers/usb/serial/option.c
@@ -522,6 +522,7 @@ static void option_instat_callback(struct urb *urb);
522 522
523/* TP-LINK Incorporated products */ 523/* TP-LINK Incorporated products */
524#define TPLINK_VENDOR_ID 0x2357 524#define TPLINK_VENDOR_ID 0x2357
525#define TPLINK_PRODUCT_LTE 0x000D
525#define TPLINK_PRODUCT_MA180 0x0201 526#define TPLINK_PRODUCT_MA180 0x0201
526 527
527/* Changhong products */ 528/* Changhong products */
@@ -2011,6 +2012,7 @@ static const struct usb_device_id option_ids[] = {
2011 { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) }, 2012 { USB_DEVICE(CELLIENT_VENDOR_ID, CELLIENT_PRODUCT_MEN200) },
2012 { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) }, 2013 { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600A) },
2013 { USB_DEVICE(PETATEL_VENDOR_ID, PETATEL_PRODUCT_NP10T_600E) }, 2014 { 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 */
2014 { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180), 2016 { USB_DEVICE(TPLINK_VENDOR_ID, TPLINK_PRODUCT_MA180),
2015 .driver_info = (kernel_ulong_t)&net_intf4_blacklist }, 2017 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
2016 { USB_DEVICE(TPLINK_VENDOR_ID, 0x9000), /* TP-Link MA260 */ 2018 { USB_DEVICE(TPLINK_VENDOR_ID, 0x9000), /* TP-Link MA260 */
diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
index ebc0beea69d6..eb9928963a53 100644
--- a/drivers/usb/serial/qcserial.c
+++ b/drivers/usb/serial/qcserial.c
@@ -174,6 +174,10 @@ static const struct usb_device_id id_table[] = {
174 {DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */ 174 {DEVICE_SWI(0x413c, 0x81b3)}, /* Dell Wireless 5809e Gobi(TM) 4G LTE Mobile Broadband Card (rev3) */
175 {DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */ 175 {DEVICE_SWI(0x413c, 0x81b5)}, /* Dell Wireless 5811e QDL */
176 {DEVICE_SWI(0x413c, 0x81b6)}, /* Dell Wireless 5811e QDL */ 176 {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 */
177 181
178 /* Huawei devices */ 182 /* Huawei devices */
179 {DEVICE_HWI(0x03f0, 0x581d)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */ 183 {DEVICE_HWI(0x03f0, 0x581d)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */