From ed6232893c9dffec587a18afca04137d98328ab0 Mon Sep 17 00:00:00 2001 From: Kyle Evans Date: Fri, 29 Nov 2019 03:51:01 +0000 Subject: [PATCH] snp: don't reference tp->t_mtx directly This is the only part of snp(4) that pokes around in struct tty directly; replace it with the tty_getlock accessor to avoid struct tty internals. --- sys/dev/snp/snp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/snp/snp.c b/sys/dev/snp/snp.c index dce8a9846558..64e2d0f64537 100644 --- a/sys/dev/snp/snp.c +++ b/sys/dev/snp/snp.c @@ -178,7 +178,7 @@ snp_read(struct cdev *dev, struct uio *uio, int flag) error = EWOULDBLOCK; break; } - error = cv_wait_sig(&ss->snp_outwait, tp->t_mtx); + error = cv_wait_sig(&ss->snp_outwait, tty_getlock(tp)); if (error != 0) break; if (tty_gone(tp)) {