linux-stable/drivers/tty
Randy Dunlap bf6d0e32f3 serial: uartlite: fix exit path null pointer
commit a553add084 upstream.

Call uart_unregister_driver() conditionally instead of
unconditionally, only if it has been previously registered.

This uses driver.state, just as the sh-sci.c driver does.

Fixes this null pointer dereference in tty_unregister_driver(),
since the 'driver' argument is null:

  general protection fault: 0000 [#1] PREEMPT SMP KASAN PTI
  RIP: 0010:tty_unregister_driver+0x25/0x1d0

Fixes: 238b8721a5 ("[PATCH] serial uartlite driver")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: stable <stable@vger.kernel.org>
Cc: Peter Korsgaard <jacmet@sunsite.dk>
Link: https://lore.kernel.org/r/9c8e6581-6fcc-a595-0897-4d90f5d710df@infradead.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-10-17 13:43:29 -07:00
..
hvc hvc_opal: don't set tb_ticks_per_usec in udbg_init_opal_common() 2018-08-03 07:50:25 +02:00
ipwireless tty: ipwireless: fix missing checks for ioremap 2019-05-31 06:47:32 -07:00
serdev serdev: fix memleak on module unload 2018-07-08 15:30:47 +02:00
serial serial: uartlite: fix exit path null pointer 2019-10-17 13:43:29 -07:00
vt tty/vt: fix write/write race in ioctl(KDSKBSENT) handler 2019-05-21 18:50:18 +02:00
Kconfig tty: ldisc: add sysctl to prevent autoloading of ldiscs 2019-04-17 08:37:45 +02:00
Makefile
amiserial.c
bfin_jtag_comm.c
cyclades.c
ehv_bytechan.c
goldfish.c
isicom.c
metag_da.c
mips_ejtag_fdc.c
moxa.c
moxa.h
mxser.c
mxser.h
n_gsm.c
n_hdlc.c tty/n_hdlc: fix __might_sleep warning 2019-01-31 08:13:44 +01:00
n_null.c
n_r3964.c
n_tracerouter.c
n_tracesink.c
n_tracesink.h
n_tty.c tty: wipe buffer if not echoing data 2018-12-01 09:42:59 +01:00
nozomi.c
pty.c pty: fix O_CLOEXEC for TIOCGPTPEER 2018-08-24 13:08:55 +02:00
rocket.c tty: rocket: fix incorrect forward declaration of 'rp_init()' 2019-07-10 09:54:42 +02:00
rocket.h
rocket_int.h
synclink.c
synclink_gt.c
synclinkmp.c
sysrq.c
tty_audit.c
tty_baudrate.c termios, tty/tty_baudrate.c: fix buffer overrun 2018-11-21 09:24:10 +01:00
tty_buffer.c tty: increase the default flip buffer limit to 2*640K 2019-04-05 22:31:37 +02:00
tty_io.c tty: ldisc: add sysctl to prevent autoloading of ldiscs 2019-04-17 08:37:45 +02:00
tty_ioctl.c
tty_jobctrl.c
tty_ldisc.c tty: ldisc: add sysctl to prevent autoloading of ldiscs 2019-04-17 08:37:45 +02:00
tty_ldsem.c tty/ldsem, locking/rwsem: Add missing ACQUIRE to read_failed sleep loop 2019-08-16 10:13:55 +02:00
tty_mutex.c
tty_port.c tty: do not set TTY_IO_ERROR flag if console port 2018-12-13 09:18:53 +01:00
vcc.c