mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 02:50:49 +09:00
USB: serial: console: fix uninitialised spinlock
commit14816b16faupstream. Since commit4a51096937("tty: Make tty_files_lock per-tty") a new tty_struct spin lock is taken in the tty release path, but the USB-serial-console hack was never updated hence leaving the lock of its "fake" tty uninitialised. This was eventually detected by lockdep. Make sure to initialise the new lock also for the fake tty to address this regression. Yes, this code is a mess, but cleaning it up is left for another day. Fixes:4a51096937("tty: Make tty_files_lock per-tty") Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
960a38eae8
commit
fef3fdf2d8
@@ -143,6 +143,7 @@ static int usb_console_setup(struct console *co, char *options)
|
||||
tty->driver = usb_serial_tty_driver;
|
||||
tty->index = co->index;
|
||||
init_ldsem(&tty->ldisc_sem);
|
||||
spin_lock_init(&tty->files_lock);
|
||||
INIT_LIST_HEAD(&tty->tty_files);
|
||||
kref_get(&tty->driver->kref);
|
||||
__module_get(tty->driver->owner);
|
||||
|
||||
Reference in New Issue
Block a user