aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/usb/serial
diff options
context:
space:
mode:
authorJohan Hovold <johan@kernel.org>2017-02-08 12:53:08 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-02-26 05:10:52 -0500
commitfef3fdf2d83cd0ca3bc0052ab58baab010929434 (patch)
tree416aa00230ee5b22f133db155181a603c217dca3 /drivers/usb/serial
parent960a38eae80a9e5ba9688c0eb92114f6de028904 (diff)
USB: serial: console: fix uninitialised spinlock
commit 14816b16fa0adac24f82492f18fa62c55acabbbe upstream. Since commit 4a510969374a ("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: 4a510969374a ("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>
Diffstat (limited to 'drivers/usb/serial')
-rw-r--r--drivers/usb/serial/console.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/usb/serial/console.c b/drivers/usb/serial/console.c
index 8967715fe6fc..b6f1adefb758 100644
--- a/drivers/usb/serial/console.c
+++ b/drivers/usb/serial/console.c
@@ -143,6 +143,7 @@ static int usb_console_setup(struct console *co, char *options)
143 tty->driver = usb_serial_tty_driver; 143 tty->driver = usb_serial_tty_driver;
144 tty->index = co->index; 144 tty->index = co->index;
145 init_ldsem(&tty->ldisc_sem); 145 init_ldsem(&tty->ldisc_sem);
146 spin_lock_init(&tty->files_lock);
146 INIT_LIST_HEAD(&tty->tty_files); 147 INIT_LIST_HEAD(&tty->tty_files);
147 kref_get(&tty->driver->kref); 148 kref_get(&tty->driver->kref);
148 __module_get(tty->driver->owner); 149 __module_get(tty->driver->owner);