aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/cx
diff options
context:
space:
mode:
authorRoman Kurakin <rik@FreeBSD.org>2004-06-10 13:50:28 +0000
committerRoman Kurakin <rik@FreeBSD.org>2004-06-10 13:50:28 +0000
commit2a8436eae5b075c64f57f32ac04b1bb41ed99cf6 (patch)
treeb49d5d471ff8131aabf2b66e2c9409f031e21a66 /sys/dev/cx
parent7ad8bf410dc6074136a7af0f3037f5a6a6b7a11d (diff)
Notes
Diffstat (limited to 'sys/dev/cx')
-rw-r--r--sys/dev/cx/if_cx.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/sys/dev/cx/if_cx.c b/sys/dev/cx/if_cx.c
index 17f98c2f6449..726de528f135 100644
--- a/sys/dev/cx/if_cx.c
+++ b/sys/dev/cx/if_cx.c
@@ -1037,6 +1037,14 @@ static int cx_detach (device_t dev)
if (!d || d->chan->type == T_NONE)
continue;
+
+#if __FreeBSD_version >= 502113
+ if (d->tty) {
+ ttyrel (d->tty);
+ d->tty = NULL;
+ }
+#endif
+
#ifdef NETGRAPH
#if __FreeBSD_version >= 500000
if (d->node) {
@@ -1735,7 +1743,13 @@ static int cx_close (dev_t dev, int flag, int mode, struct thread *td)
splx (s);
d->callout = 0;
- /* Wake up bidirectional opens. */
+ /*
+ * Wake up bidirectional opens.
+ * Since we may be opened twice we couldn't call ttyrel() here.
+ * So just keep d->tty for future use. It would be freed by
+ * ttyrel() at cx_detach().
+ */
+
wakeup (d);
d->open_dev &= ~0x2;