From 5ce4db64324c3291d953e096a4d159678465b306 Mon Sep 17 00:00:00 2001 From: rwatson Date: Mon, 12 Mar 2007 14:52:00 +0000 Subject: [PATCH] In uipc_close(), we no longer always free the unpcb, as the last reference may be dropped later. In this case, always unlock the unpcb so as not to leak the lock. Found by: kris (BugMagnet) --- sys/kern/uipc_usrreq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c index 17a8fb5c8661..79da63bb705e 100644 --- a/sys/kern/uipc_usrreq.c +++ b/sys/kern/uipc_usrreq.c @@ -593,7 +593,8 @@ uipc_detach(struct socket *so) if (freeunp) { UNP_PCB_LOCK_DESTROY(unp); uma_zfree(unp_zone, unp); - } + } else + UNP_PCB_UNLOCK(unp); if (vp) { int vfslocked;