aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/usb')
-rw-r--r--drivers/usb/gadget/u_serial.c5
-rw-r--r--drivers/usb/serial/usb-serial.c1
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
index f1739526820f..d0f95482f40e 100644
--- a/drivers/usb/gadget/u_serial.c
+++ b/drivers/usb/gadget/u_serial.c
@@ -1145,8 +1145,10 @@ int gserial_setup(struct usb_gadget *g, unsigned count)
1145 1145
1146 return status; 1146 return status;
1147fail: 1147fail:
1148 while (count--) 1148 while (count--) {
1149 tty_port_destroy(&ports[count].port->port);
1149 kfree(ports[count].port); 1150 kfree(ports[count].port);
1151 }
1150 put_tty_driver(gs_tty_driver); 1152 put_tty_driver(gs_tty_driver);
1151 gs_tty_driver = NULL; 1153 gs_tty_driver = NULL;
1152 return status; 1154 return status;
@@ -1200,6 +1202,7 @@ void gserial_cleanup(void)
1200 1202
1201 WARN_ON(port->port_usb != NULL); 1203 WARN_ON(port->port_usb != NULL);
1202 1204
1205 tty_port_destroy(&port->port);
1203 kfree(port); 1206 kfree(port);
1204 } 1207 }
1205 n_ports = 0; 1208 n_ports = 0;
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
index 73b8e0569164..64bda135ba7e 100644
--- a/drivers/usb/serial/usb-serial.c
+++ b/drivers/usb/serial/usb-serial.c
@@ -597,6 +597,7 @@ static void port_release(struct device *dev)
597 kfifo_free(&port->write_fifo); 597 kfifo_free(&port->write_fifo);
598 kfree(port->interrupt_in_buffer); 598 kfree(port->interrupt_in_buffer);
599 kfree(port->interrupt_out_buffer); 599 kfree(port->interrupt_out_buffer);
600 tty_port_destroy(&port->port);
600 kfree(port); 601 kfree(port);
601} 602}
602 603