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.
This commit is contained in:
Kyle Evans 2019-11-29 03:51:01 +00:00
parent 74aed808a1
commit ed6232893c

View File

@ -178,7 +178,7 @@ snp_read(struct cdev *dev, struct uio *uio, int flag)
error = EWOULDBLOCK; error = EWOULDBLOCK;
break; break;
} }
error = cv_wait_sig(&ss->snp_outwait, tp->t_mtx); error = cv_wait_sig(&ss->snp_outwait, tty_getlock(tp));
if (error != 0) if (error != 0)
break; break;
if (tty_gone(tp)) { if (tty_gone(tp)) {