diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c index 601c377042f..df3d9eb3fd2 100644 --- a/sys/dev/uart/uart_tty.c +++ b/sys/dev/uart/uart_tty.c @@ -137,6 +137,10 @@ uart_tty_open(struct tty *tp, struct cdev *dev) struct uart_softc *sc; sc = tp->t_sc; + + if (sc == NULL || sc->sc_leaving) + return (ENXIO); + sc->sc_opened = 1; return (0); }