Commit a949b9ea authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

Merge tag 'usb-serial-5.12-rc3' of...

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

Johan writes:

USB-serial fixes for 5.12-rc3

Here's a fix for a long-standing memory leak after probe failure in
io_edgeport and a fix for a NULL-deref on disconnect in the new xr
driver.

Included are also some new device ids.

All have been in linux-next with no reported issues.

* tag 'usb-serial-5.12-rc3' of https://git.kernel.org/pub/scm/linux/kernel/git/johan/usb-serial:
  USB: serial: io_edgeport: fix memory leak in edge_startup
  USB: serial: ch341: add new Product ID
  USB: serial: xr: fix NULL-deref on disconnect
  USB: serial: cp210x: add some more GE USB IDs
  USB: serial: cp210x: add ID for Acuity Brands nLight Air Adapter
parents 46613c9d cfdc67ac
...@@ -86,6 +86,7 @@ static const struct usb_device_id id_table[] = { ...@@ -86,6 +86,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x1a86, 0x7522) }, { USB_DEVICE(0x1a86, 0x7522) },
{ USB_DEVICE(0x1a86, 0x7523) }, { USB_DEVICE(0x1a86, 0x7523) },
{ USB_DEVICE(0x4348, 0x5523) }, { USB_DEVICE(0x4348, 0x5523) },
{ USB_DEVICE(0x9986, 0x7523) },
{ }, { },
}; };
MODULE_DEVICE_TABLE(usb, id_table); MODULE_DEVICE_TABLE(usb, id_table);
......
...@@ -145,6 +145,7 @@ static const struct usb_device_id id_table[] = { ...@@ -145,6 +145,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */ { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */
{ USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
{ USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */ { USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
{ USB_DEVICE(0x10C4, 0x88D8) }, /* Acuity Brands nLight Air Adapter */
{ USB_DEVICE(0x10C4, 0x88FB) }, /* CESINEL MEDCAL STII Network Analyzer */ { USB_DEVICE(0x10C4, 0x88FB) }, /* CESINEL MEDCAL STII Network Analyzer */
{ USB_DEVICE(0x10C4, 0x8938) }, /* CESINEL MEDCAL S II Network Analyzer */ { USB_DEVICE(0x10C4, 0x8938) }, /* CESINEL MEDCAL S II Network Analyzer */
{ USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */ { USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
...@@ -201,6 +202,8 @@ static const struct usb_device_id id_table[] = { ...@@ -201,6 +202,8 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */ { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */
{ USB_DEVICE(0x1901, 0x0195) }, /* GE B850/B650/B450 CP2104 DP UART interface */ { USB_DEVICE(0x1901, 0x0195) }, /* GE B850/B650/B450 CP2104 DP UART interface */
{ USB_DEVICE(0x1901, 0x0196) }, /* GE B850 CP2105 DP UART interface */ { USB_DEVICE(0x1901, 0x0196) }, /* GE B850 CP2105 DP UART interface */
{ USB_DEVICE(0x1901, 0x0197) }, /* GE CS1000 Display serial interface */
{ USB_DEVICE(0x1901, 0x0198) }, /* GE CS1000 M.2 Key E serial interface */
{ USB_DEVICE(0x199B, 0xBA30) }, /* LORD WSDA-200-USB */ { USB_DEVICE(0x199B, 0xBA30) }, /* LORD WSDA-200-USB */
{ USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */ { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */
{ USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */
......
...@@ -3003,26 +3003,32 @@ static int edge_startup(struct usb_serial *serial) ...@@ -3003,26 +3003,32 @@ static int edge_startup(struct usb_serial *serial)
response = -ENODEV; response = -ENODEV;
} }
usb_free_urb(edge_serial->interrupt_read_urb); goto error;
kfree(edge_serial->interrupt_in_buffer);
usb_free_urb(edge_serial->read_urb);
kfree(edge_serial->bulk_in_buffer);
kfree(edge_serial);
return response;
} }
/* start interrupt read for this edgeport this interrupt will /* start interrupt read for this edgeport this interrupt will
* continue as long as the edgeport is connected */ * continue as long as the edgeport is connected */
response = usb_submit_urb(edge_serial->interrupt_read_urb, response = usb_submit_urb(edge_serial->interrupt_read_urb,
GFP_KERNEL); GFP_KERNEL);
if (response) if (response) {
dev_err(ddev, "%s - Error %d submitting control urb\n", dev_err(ddev, "%s - Error %d submitting control urb\n",
__func__, response); __func__, response);
goto error;
}
} }
return response; return response;
error:
usb_free_urb(edge_serial->interrupt_read_urb);
kfree(edge_serial->interrupt_in_buffer);
usb_free_urb(edge_serial->read_urb);
kfree(edge_serial->bulk_in_buffer);
kfree(edge_serial);
return response;
} }
......
...@@ -545,37 +545,13 @@ static void xr_close(struct usb_serial_port *port) ...@@ -545,37 +545,13 @@ static void xr_close(struct usb_serial_port *port)
static int xr_probe(struct usb_serial *serial, const struct usb_device_id *id) static int xr_probe(struct usb_serial *serial, const struct usb_device_id *id)
{ {
struct usb_driver *driver = serial->type->usb_driver;
struct usb_interface *control_interface;
int ret;
/* Don't bind to control interface */ /* Don't bind to control interface */
if (serial->interface->cur_altsetting->desc.bInterfaceNumber == 0) if (serial->interface->cur_altsetting->desc.bInterfaceNumber == 0)
return -ENODEV; return -ENODEV;
/* But claim the control interface during data interface probe */
control_interface = usb_ifnum_to_if(serial->dev, 0);
if (!control_interface)
return -ENODEV;
ret = usb_driver_claim_interface(driver, control_interface, NULL);
if (ret) {
dev_err(&serial->interface->dev, "Failed to claim control interface\n");
return ret;
}
return 0; return 0;
} }
static void xr_disconnect(struct usb_serial *serial)
{
struct usb_driver *driver = serial->type->usb_driver;
struct usb_interface *control_interface;
control_interface = usb_ifnum_to_if(serial->dev, 0);
usb_driver_release_interface(driver, control_interface);
}
static const struct usb_device_id id_table[] = { static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x04e2, 0x1410) }, /* XR21V141X */ { USB_DEVICE(0x04e2, 0x1410) }, /* XR21V141X */
{ } { }
...@@ -590,7 +566,6 @@ static struct usb_serial_driver xr_device = { ...@@ -590,7 +566,6 @@ static struct usb_serial_driver xr_device = {
.id_table = id_table, .id_table = id_table,
.num_ports = 1, .num_ports = 1,
.probe = xr_probe, .probe = xr_probe,
.disconnect = xr_disconnect,
.open = xr_open, .open = xr_open,
.close = xr_close, .close = xr_close,
.break_ctl = xr_break_ctl, .break_ctl = xr_break_ctl,
......
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