Skip to content

Commit a949b9e

Browse files
committed
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
2 parents 46613c9 + cfdc67a commit a949b9e

4 files changed

Lines changed: 20 additions & 35 deletions

File tree

drivers/usb/serial/ch341.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ static const struct usb_device_id id_table[] = {
8686
{ USB_DEVICE(0x1a86, 0x7522) },
8787
{ USB_DEVICE(0x1a86, 0x7523) },
8888
{ USB_DEVICE(0x4348, 0x5523) },
89+
{ USB_DEVICE(0x9986, 0x7523) },
8990
{ },
9091
};
9192
MODULE_DEVICE_TABLE(usb, id_table);

drivers/usb/serial/cp210x.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ static const struct usb_device_id id_table[] = {
145145
{ USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */
146146
{ USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */
147147
{ USB_DEVICE(0x10C4, 0x88A5) }, /* Planet Innovation Ingeni ZigBee USB Device */
148+
{ USB_DEVICE(0x10C4, 0x88D8) }, /* Acuity Brands nLight Air Adapter */
148149
{ USB_DEVICE(0x10C4, 0x88FB) }, /* CESINEL MEDCAL STII Network Analyzer */
149150
{ USB_DEVICE(0x10C4, 0x8938) }, /* CESINEL MEDCAL S II Network Analyzer */
150151
{ USB_DEVICE(0x10C4, 0x8946) }, /* Ketra N1 Wireless Interface */
@@ -201,6 +202,8 @@ static const struct usb_device_id id_table[] = {
201202
{ USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */
202203
{ USB_DEVICE(0x1901, 0x0195) }, /* GE B850/B650/B450 CP2104 DP UART interface */
203204
{ USB_DEVICE(0x1901, 0x0196) }, /* GE B850 CP2105 DP UART interface */
205+
{ USB_DEVICE(0x1901, 0x0197) }, /* GE CS1000 Display serial interface */
206+
{ USB_DEVICE(0x1901, 0x0198) }, /* GE CS1000 M.2 Key E serial interface */
204207
{ USB_DEVICE(0x199B, 0xBA30) }, /* LORD WSDA-200-USB */
205208
{ USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */
206209
{ USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */

drivers/usb/serial/io_edgeport.c

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3003,26 +3003,32 @@ static int edge_startup(struct usb_serial *serial)
30033003
response = -ENODEV;
30043004
}
30053005

3006-
usb_free_urb(edge_serial->interrupt_read_urb);
3007-
kfree(edge_serial->interrupt_in_buffer);
3008-
3009-
usb_free_urb(edge_serial->read_urb);
3010-
kfree(edge_serial->bulk_in_buffer);
3011-
3012-
kfree(edge_serial);
3013-
3014-
return response;
3006+
goto error;
30153007
}
30163008

30173009
/* start interrupt read for this edgeport this interrupt will
30183010
* continue as long as the edgeport is connected */
30193011
response = usb_submit_urb(edge_serial->interrupt_read_urb,
30203012
GFP_KERNEL);
3021-
if (response)
3013+
if (response) {
30223014
dev_err(ddev, "%s - Error %d submitting control urb\n",
30233015
__func__, response);
3016+
3017+
goto error;
3018+
}
30243019
}
30253020
return response;
3021+
3022+
error:
3023+
usb_free_urb(edge_serial->interrupt_read_urb);
3024+
kfree(edge_serial->interrupt_in_buffer);
3025+
3026+
usb_free_urb(edge_serial->read_urb);
3027+
kfree(edge_serial->bulk_in_buffer);
3028+
3029+
kfree(edge_serial);
3030+
3031+
return response;
30263032
}
30273033

30283034

drivers/usb/serial/xr_serial.c

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -545,37 +545,13 @@ static void xr_close(struct usb_serial_port *port)
545545

546546
static int xr_probe(struct usb_serial *serial, const struct usb_device_id *id)
547547
{
548-
struct usb_driver *driver = serial->type->usb_driver;
549-
struct usb_interface *control_interface;
550-
int ret;
551-
552548
/* Don't bind to control interface */
553549
if (serial->interface->cur_altsetting->desc.bInterfaceNumber == 0)
554550
return -ENODEV;
555551

556-
/* But claim the control interface during data interface probe */
557-
control_interface = usb_ifnum_to_if(serial->dev, 0);
558-
if (!control_interface)
559-
return -ENODEV;
560-
561-
ret = usb_driver_claim_interface(driver, control_interface, NULL);
562-
if (ret) {
563-
dev_err(&serial->interface->dev, "Failed to claim control interface\n");
564-
return ret;
565-
}
566-
567552
return 0;
568553
}
569554

570-
static void xr_disconnect(struct usb_serial *serial)
571-
{
572-
struct usb_driver *driver = serial->type->usb_driver;
573-
struct usb_interface *control_interface;
574-
575-
control_interface = usb_ifnum_to_if(serial->dev, 0);
576-
usb_driver_release_interface(driver, control_interface);
577-
}
578-
579555
static const struct usb_device_id id_table[] = {
580556
{ USB_DEVICE(0x04e2, 0x1410) }, /* XR21V141X */
581557
{ }
@@ -590,7 +566,6 @@ static struct usb_serial_driver xr_device = {
590566
.id_table = id_table,
591567
.num_ports = 1,
592568
.probe = xr_probe,
593-
.disconnect = xr_disconnect,
594569
.open = xr_open,
595570
.close = xr_close,
596571
.break_ctl = xr_break_ctl,

0 commit comments

Comments
 (0)