These two fixes ensure the new "CDC Composite Device" gadget
fails cleanly when it's loaded on hardware that can't support
this particular gadget driver.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
return status;
status = acm_bind_config(c, 0);
- if (status == 0)
+ if (status < 0)
return status;
return 0;
unsigned i;
struct gs_port *port;
+ if (!gs_tty_driver)
+ return;
+
/* start sysfs and /dev/ttyGS* node removal */
for (i = 0; i < n_ports; i++)
tty_unregister_device(gs_tty_driver, i);