summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2007-03-12 14:52:00 +0000
committerrwatson <rwatson@FreeBSD.org>2007-03-12 14:52:00 +0000
commit5ce4db64324c3291d953e096a4d159678465b306 (patch)
tree471cfe2e4cf11604e736884644b7c0d43782a9d9 /sys/kern
parent117cebb87315725246fcba8bbc6f9b1968c49889 (diff)
downloadFreeBSD-src-5ce4db64324c3291d953e096a4d159678465b306.zip
FreeBSD-src-5ce4db64324c3291d953e096a4d159678465b306.tar.gz
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)
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/uipc_usrreq.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/uipc_usrreq.c b/sys/kern/uipc_usrreq.c
index 17a8fb5..79da63b 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;
OpenPOWER on IntegriCloud