Commit 6844dc42 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'usb-serial-4.17-rc4' of...

Merge tag 'usb-serial-4.17-rc4' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial into usb-linus

Johan writes:

USB-serial fixes for v4.17-rc4

Here's a fix for a long-standing issue in the visor driver, which could
have security implications. Included is also a new modem device id.

Both commits have been in linux-next for a couple of days with no
reported issues.
Signed-off-by: default avatarJohan Hovold <johan@kernel.org>
parents 43b78f11 4842ed5b
...@@ -233,6 +233,8 @@ static void option_instat_callback(struct urb *urb); ...@@ -233,6 +233,8 @@ static void option_instat_callback(struct urb *urb);
/* These Quectel products use Qualcomm's vendor ID */ /* These Quectel products use Qualcomm's vendor ID */
#define QUECTEL_PRODUCT_UC20 0x9003 #define QUECTEL_PRODUCT_UC20 0x9003
#define QUECTEL_PRODUCT_UC15 0x9090 #define QUECTEL_PRODUCT_UC15 0x9090
/* These u-blox products use Qualcomm's vendor ID */
#define UBLOX_PRODUCT_R410M 0x90b2
/* These Yuga products use Qualcomm's vendor ID */ /* These Yuga products use Qualcomm's vendor ID */
#define YUGA_PRODUCT_CLM920_NC5 0x9625 #define YUGA_PRODUCT_CLM920_NC5 0x9625
...@@ -1065,6 +1067,9 @@ static const struct usb_device_id option_ids[] = { ...@@ -1065,6 +1067,9 @@ static const struct usb_device_id option_ids[] = {
/* Yuga products use Qualcomm vendor ID */ /* Yuga products use Qualcomm vendor ID */
{ USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5), { USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5),
.driver_info = RSVD(1) | RSVD(4) }, .driver_info = RSVD(1) | RSVD(4) },
/* u-blox products using Qualcomm vendor ID */
{ USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M),
.driver_info = RSVD(1) | RSVD(3) },
/* Quectel products using Quectel vendor ID */ /* Quectel products using Quectel vendor ID */
{ USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21),
.driver_info = RSVD(4) }, .driver_info = RSVD(4) },
......
...@@ -335,14 +335,25 @@ static int palm_os_3_probe(struct usb_serial *serial, ...@@ -335,14 +335,25 @@ static int palm_os_3_probe(struct usb_serial *serial,
goto exit; goto exit;
} }
if (retval == sizeof(*connection_info)) { if (retval != sizeof(*connection_info)) {
connection_info = (struct visor_connection_info *) dev_err(dev, "Invalid connection information received from device\n");
transfer_buffer; retval = -ENODEV;
goto exit;
}
connection_info = (struct visor_connection_info *)transfer_buffer;
num_ports = le16_to_cpu(connection_info->num_ports); num_ports = le16_to_cpu(connection_info->num_ports);
/* Handle devices that report invalid stuff here. */
if (num_ports == 0 || num_ports > 2) {
dev_warn(dev, "%s: No valid connect info available\n",
serial->type->description);
num_ports = 2;
}
for (i = 0; i < num_ports; ++i) { for (i = 0; i < num_ports; ++i) {
switch ( switch (connection_info->connections[i].port_function_id) {
connection_info->connections[i].port_function_id) {
case VISOR_FUNCTION_GENERIC: case VISOR_FUNCTION_GENERIC:
string = "Generic"; string = "Generic";
break; break;
...@@ -366,16 +377,6 @@ static int palm_os_3_probe(struct usb_serial *serial, ...@@ -366,16 +377,6 @@ static int palm_os_3_probe(struct usb_serial *serial,
serial->type->description, serial->type->description,
connection_info->connections[i].port, string); connection_info->connections[i].port, string);
} }
}
/*
* Handle devices that report invalid stuff here.
*/
if (num_ports == 0 || num_ports > 2) {
dev_warn(dev, "%s: No valid connect info available\n",
serial->type->description);
num_ports = 2;
}
dev_info(dev, "%s: Number of ports: %d\n", serial->type->description, dev_info(dev, "%s: Number of ports: %d\n", serial->type->description,
num_ports); num_ports);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment