diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-04 17:38:32 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-05-04 17:38:32 -0400 |
| commit | 6844dc42722cac37762a45e742ab4b2cc5348023 (patch) | |
| tree | 04d8190aa5c34480dc9c5ba1aca85675b875e448 | |
| parent | 43b78f1155c868208a413082179251f5fba78153 (diff) | |
| parent | 4842ed5bfcb9daf6660537d70503c18d38dbdbb8 (diff) | |
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: Johan Hovold <johan@kernel.org>
| -rw-r--r-- | drivers/usb/serial/option.c | 5 | ||||
| -rw-r--r-- | drivers/usb/serial/visor.c | 69 |
2 files changed, 40 insertions, 34 deletions
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index c3f252283ab9..2058852a87fa 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
| @@ -233,6 +233,8 @@ static void option_instat_callback(struct urb *urb); | |||
| 233 | /* These Quectel products use Qualcomm's vendor ID */ | 233 | /* These Quectel products use Qualcomm's vendor ID */ |
| 234 | #define QUECTEL_PRODUCT_UC20 0x9003 | 234 | #define QUECTEL_PRODUCT_UC20 0x9003 |
| 235 | #define QUECTEL_PRODUCT_UC15 0x9090 | 235 | #define QUECTEL_PRODUCT_UC15 0x9090 |
| 236 | /* These u-blox products use Qualcomm's vendor ID */ | ||
| 237 | #define UBLOX_PRODUCT_R410M 0x90b2 | ||
| 236 | /* These Yuga products use Qualcomm's vendor ID */ | 238 | /* These Yuga products use Qualcomm's vendor ID */ |
| 237 | #define YUGA_PRODUCT_CLM920_NC5 0x9625 | 239 | #define YUGA_PRODUCT_CLM920_NC5 0x9625 |
| 238 | 240 | ||
| @@ -1065,6 +1067,9 @@ static const struct usb_device_id option_ids[] = { | |||
| 1065 | /* Yuga products use Qualcomm vendor ID */ | 1067 | /* Yuga products use Qualcomm vendor ID */ |
| 1066 | { USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5), | 1068 | { USB_DEVICE(QUALCOMM_VENDOR_ID, YUGA_PRODUCT_CLM920_NC5), |
| 1067 | .driver_info = RSVD(1) | RSVD(4) }, | 1069 | .driver_info = RSVD(1) | RSVD(4) }, |
| 1070 | /* u-blox products using Qualcomm vendor ID */ | ||
| 1071 | { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M), | ||
| 1072 | .driver_info = RSVD(1) | RSVD(3) }, | ||
| 1068 | /* Quectel products using Quectel vendor ID */ | 1073 | /* Quectel products using Quectel vendor ID */ |
| 1069 | { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), | 1074 | { USB_DEVICE(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21), |
| 1070 | .driver_info = RSVD(4) }, | 1075 | .driver_info = RSVD(4) }, |
diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index f5373ed2cd45..8ddbecc25d89 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c | |||
| @@ -335,47 +335,48 @@ static int palm_os_3_probe(struct usb_serial *serial, | |||
| 335 | goto exit; | 335 | goto exit; |
| 336 | } | 336 | } |
| 337 | 337 | ||
| 338 | if (retval == sizeof(*connection_info)) { | 338 | if (retval != sizeof(*connection_info)) { |
| 339 | connection_info = (struct visor_connection_info *) | 339 | dev_err(dev, "Invalid connection information received from device\n"); |
| 340 | transfer_buffer; | 340 | retval = -ENODEV; |
| 341 | 341 | goto exit; | |
| 342 | num_ports = le16_to_cpu(connection_info->num_ports); | ||
| 343 | for (i = 0; i < num_ports; ++i) { | ||
| 344 | switch ( | ||
| 345 | connection_info->connections[i].port_function_id) { | ||
| 346 | case VISOR_FUNCTION_GENERIC: | ||
| 347 | string = "Generic"; | ||
| 348 | break; | ||
| 349 | case VISOR_FUNCTION_DEBUGGER: | ||
| 350 | string = "Debugger"; | ||
| 351 | break; | ||
| 352 | case VISOR_FUNCTION_HOTSYNC: | ||
| 353 | string = "HotSync"; | ||
| 354 | break; | ||
| 355 | case VISOR_FUNCTION_CONSOLE: | ||
| 356 | string = "Console"; | ||
| 357 | break; | ||
| 358 | case VISOR_FUNCTION_REMOTE_FILE_SYS: | ||
| 359 | string = "Remote File System"; | ||
| 360 | break; | ||
| 361 | default: | ||
| 362 | string = "unknown"; | ||
| 363 | break; | ||
| 364 | } | ||
| 365 | dev_info(dev, "%s: port %d, is for %s use\n", | ||
| 366 | serial->type->description, | ||
| 367 | connection_info->connections[i].port, string); | ||
| 368 | } | ||
| 369 | } | 342 | } |
| 370 | /* | 343 | |
| 371 | * Handle devices that report invalid stuff here. | 344 | connection_info = (struct visor_connection_info *)transfer_buffer; |
| 372 | */ | 345 | |
| 346 | num_ports = le16_to_cpu(connection_info->num_ports); | ||
| 347 | |||
| 348 | /* Handle devices that report invalid stuff here. */ | ||
| 373 | if (num_ports == 0 || num_ports > 2) { | 349 | if (num_ports == 0 || num_ports > 2) { |
| 374 | dev_warn(dev, "%s: No valid connect info available\n", | 350 | dev_warn(dev, "%s: No valid connect info available\n", |
| 375 | serial->type->description); | 351 | serial->type->description); |
| 376 | num_ports = 2; | 352 | num_ports = 2; |
| 377 | } | 353 | } |
| 378 | 354 | ||
| 355 | for (i = 0; i < num_ports; ++i) { | ||
| 356 | switch (connection_info->connections[i].port_function_id) { | ||
| 357 | case VISOR_FUNCTION_GENERIC: | ||
| 358 | string = "Generic"; | ||
| 359 | break; | ||
| 360 | case VISOR_FUNCTION_DEBUGGER: | ||
| 361 | string = "Debugger"; | ||
| 362 | break; | ||
| 363 | case VISOR_FUNCTION_HOTSYNC: | ||
| 364 | string = "HotSync"; | ||
| 365 | break; | ||
| 366 | case VISOR_FUNCTION_CONSOLE: | ||
| 367 | string = "Console"; | ||
| 368 | break; | ||
| 369 | case VISOR_FUNCTION_REMOTE_FILE_SYS: | ||
| 370 | string = "Remote File System"; | ||
| 371 | break; | ||
| 372 | default: | ||
| 373 | string = "unknown"; | ||
| 374 | break; | ||
| 375 | } | ||
| 376 | dev_info(dev, "%s: port %d, is for %s use\n", | ||
| 377 | serial->type->description, | ||
| 378 | connection_info->connections[i].port, string); | ||
| 379 | } | ||
| 379 | dev_info(dev, "%s: Number of ports: %d\n", serial->type->description, | 380 | dev_info(dev, "%s: Number of ports: %d\n", serial->type->description, |
| 380 | num_ports); | 381 | num_ports); |
| 381 | 382 | ||
