mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
serial_core: Unregister console in uart_remove_one_port()
If the serial port being removed is used as a console, it must also be unregistered from the console subsystem using unregister_console(). uart_ops.release_port() will release resources (e.g. iounmap() the serial port registers), causing a crash on subsequent kernel output if the console is still registered. Signed-off-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
a3c1fa99f4
commit
5f5c9ae56c
1 changed files with 6 additions and 0 deletions
|
|
@ -2676,6 +2676,12 @@ int uart_remove_one_port(struct uart_driver *drv, struct uart_port *uport)
|
|||
if (port->tty)
|
||||
tty_vhangup(port->tty);
|
||||
|
||||
/*
|
||||
* If the port is used as a console, unregister it
|
||||
*/
|
||||
if (uart_console(uport))
|
||||
unregister_console(uport->cons);
|
||||
|
||||
/*
|
||||
* Free the port IO and memory resources, if any.
|
||||
*/
|
||||
|
|
|
|||
Loading…
Reference in a new issue