Skip to content

Commit 14816b1

Browse files
committed
USB: serial: console: fix uninitialised spinlock
Since commit 4a51096 ("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: 4a51096 ("tty: Make tty_files_lock per-tty") Cc: stable <[email protected]> # 4.6 Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Johan Hovold <[email protected]>
1 parent acfe276 commit 14816b1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/usb/serial/console.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ static int usb_console_setup(struct console *co, char *options)
143143
tty->driver = usb_serial_tty_driver;
144144
tty->index = co->index;
145145
init_ldsem(&tty->ldisc_sem);
146+
spin_lock_init(&tty->files_lock);
146147
INIT_LIST_HEAD(&tty->tty_files);
147148
kref_get(&tty->driver->kref);
148149
__module_get(tty->driver->owner);

0 commit comments

Comments
 (0)