aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/usb/gadget/cdc2.c2
-rw-r--r--drivers/usb/gadget/u_serial.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/drivers/usb/gadget/cdc2.c b/drivers/usb/gadget/cdc2.c
index 289c75277135..d490d0289507 100644
--- a/drivers/usb/gadget/cdc2.c
+++ b/drivers/usb/gadget/cdc2.c
@@ -124,7 +124,7 @@ static int __init cdc_do_config(struct usb_configuration *c)
124 return status; 124 return status;
125 125
126 status = acm_bind_config(c, 0); 126 status = acm_bind_config(c, 0);
127 if (status == 0) 127 if (status < 0)
128 return status; 128 return status;
129 129
130 return 0; 130 return 0;
diff --git a/drivers/usb/gadget/u_serial.c b/drivers/usb/gadget/u_serial.c
index 88d4f5452c49..abf9505d3a75 100644
--- a/drivers/usb/gadget/u_serial.c
+++ b/drivers/usb/gadget/u_serial.c
@@ -1090,6 +1090,9 @@ void gserial_cleanup(void)
1090 unsigned i; 1090 unsigned i;
1091 struct gs_port *port; 1091 struct gs_port *port;
1092 1092
1093 if (!gs_tty_driver)
1094 return;
1095
1093 /* start sysfs and /dev/ttyGS* node removal */ 1096 /* start sysfs and /dev/ttyGS* node removal */
1094 for (i = 0; i < n_ports; i++) 1097 for (i = 0; i < n_ports; i++)
1095 tty_unregister_device(gs_tty_driver, i); 1098 tty_unregister_device(gs_tty_driver, i);