Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/pgoyette-localcount]: src/sys/kern Add a note to revisit the locking for...
details: https://anonhg.NetBSD.org/src/rev/92528238fc93
branches: pgoyette-localcount
changeset: 852881:92528238fc93
user: pgoyette <pgoyette%NetBSD.org@localhost>
date: Fri Jul 29 02:19:52 2016 +0000
description:
Add a note to revisit the locking for this device.
diffstat:
sys/kern/tty_pty.c | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diffs (31 lines):
diff -r 9b2792f88118 -r 92528238fc93 sys/kern/tty_pty.c
--- a/sys/kern/tty_pty.c Fri Jul 29 01:49:39 2016 +0000
+++ b/sys/kern/tty_pty.c Fri Jul 29 02:19:52 2016 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tty_pty.c,v 1.142.2.5 2016/07/29 01:49:39 pgoyette Exp $ */
+/* $NetBSD: tty_pty.c,v 1.142.2.6 2016/07/29 02:19:52 pgoyette Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@@ -37,7 +37,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.142.2.5 2016/07/29 01:49:39 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty_pty.c,v 1.142.2.6 2016/07/29 02:19:52 pgoyette Exp $");
#include "opt_ptm.h"
@@ -1046,6 +1046,12 @@
int
ptyioctl(dev_t dev, u_long cmd, void *data, int flag, struct lwp *l)
{
+/*
+ * XXX We really should use device_lookup_acquire(...) to lock the
+ * XXX device before fetching its softc pointer. Acquiring the
+ * XXX cdevsw prevents the driver from being detached, but doesn't
+ * XXX prevent the specific instance/unit from disappearing.
+ */
struct pt_softc *pti = pt_softc[minor(dev)];
struct tty *tp = pti->pt_tty;
const struct cdevsw *cdev;
Home |
Main Index |
Thread Index |
Old Index