serial: core: mark port as initialized in autoconfig

This is a followup on 44117a1d17 ("serial: core: mark port as
initialized after successful IRQ change").
Nikola has been using autoconfig via setserial and reported a crash
similar to what I fixed in the earlier mentioned commit. Here I do the
same fixup for the autoconfig. I wasn't sure that this is the right
approach. Nikola confirmed that it fixes his crash.

Fixes: b3b5764618 ("tty: serial_core: convert uart_open to use tty_port_open")
Link: http://lkml.kernel.org/r/[email protected]
Reported-by: Nikola Ciprich <[email protected]>
Tested-by: Nikola Ciprich <[email protected]>
Cc: <[email protected]>
Signed-off-by: Sebastian Andrzej Siewior <[email protected]>
Tested-by: Nikola Ciprich <[email protected]>
Acked-by: Johan Hovold <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Sebastian Andrzej Siewior 2018-02-03 12:27:23 +01:00 • committed by Greg Kroah-Hartman
commit 714569064a

View file

@ -1144,6 +1144,8 @@ static int uart_do_autoconfig(struct tty_struct *tty,struct uart_state *state)
uport->ops->config_port(uport, flags);
ret = uart_startup(tty, state, 1);
if (ret == 0)
tty_port_set_initialized(port, true);
if (ret > 0)
ret = 0;
}