While in current version there is no use-after-free as USB serial
core holds another reference when the console is registered, we
should better unlock before dropping the reference in
usb_console_setup().
Fixes:
7bd032dc2793 ("USB serial: update the console driver")
Signed-off-by: Liang He <windhl@126.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
info->port = NULL;
usb_autopm_put_interface(serial->interface);
error_get_interface:
- usb_serial_put(serial);
mutex_unlock(&serial->disc_mutex);
+ usb_serial_put(serial);
return retval;
}