From 572b4402d10280b03bc4d67a298fdd9b2600c66f Mon Sep 17 00:00:00 2001 From: Poul-Henning Kamp Date: Thu, 17 Mar 2005 08:44:41 +0000 Subject: In stange circumstances we may end up being the last reference to a session in tprintf(). SESSRELE() needs to properly dispose of the sessions mutex. Add sessrele() which does the proper cleanup and have SESSRELE() call it. Use SESSRELE also in pgdelete(). Found by: Coverity (ID:526) --- sys/kern/subr_prf.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'sys/kern/subr_prf.c') diff --git a/sys/kern/subr_prf.c b/sys/kern/subr_prf.c index 393906f799b2..26d4d411e82f 100644 --- a/sys/kern/subr_prf.c +++ b/sys/kern/subr_prf.c @@ -189,11 +189,8 @@ tprintf(struct proc *p, int pri, const char *fmt, ...) va_start(ap, fmt); kvprintf(fmt, putchar, &pca, 10, ap); va_end(ap); - if (sess != NULL) { - SESS_LOCK(sess); + if (sess != NULL) SESSRELE(sess); - SESS_UNLOCK(sess); - } msgbuftrigger = 1; } -- cgit v1.2.3