summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2006-03-30 03:26:52 +0000
committermarcel <marcel@FreeBSD.org>2006-03-30 03:26:52 +0000
commitd557f93c085eae21ea83357885a7a1da570fc809 (patch)
treea780248ccda2da7517c0927978f56ca059b93095
parent9dd1a6be315f21455491575b3b85f8dc78e12afa (diff)
downloadFreeBSD-src-d557f93c085eae21ea83357885a7a1da570fc809.zip
FreeBSD-src-d557f93c085eae21ea83357885a7a1da570fc809.tar.gz
Don't open if we're going away.
-rw-r--r--sys/dev/uart/uart_tty.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sys/dev/uart/uart_tty.c b/sys/dev/uart/uart_tty.c
index 601c377..df3d9eb 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);
}
OpenPOWER on IntegriCloud