summaryrefslogtreecommitdiff
path: root/sys/kern/kern_resource.c
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2004-02-06 19:35:14 +0000
committerJohn Baldwin <jhb@FreeBSD.org>2004-02-06 19:35:14 +0000
commita875f38546d82d73fd802ab3fe5bd2943d1354e7 (patch)
treef181dfe96828361676818e51365d0fe470dab7b7 /sys/kern/kern_resource.c
parentf4daf0561901f85d3b3f4a9ee58d837785cc5c4a (diff)
Notes
Diffstat (limited to 'sys/kern/kern_resource.c')
-rw-r--r--sys/kern/kern_resource.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/kern/kern_resource.c b/sys/kern/kern_resource.c
index 36084018c84a..e995d1c3dd70 100644
--- a/sys/kern/kern_resource.c
+++ b/sys/kern/kern_resource.c
@@ -837,9 +837,9 @@ lim_alloc()
struct plimit *limp;
limp = (struct plimit *)malloc(sizeof(struct plimit), M_PLIMIT,
- M_WAITOK | M_ZERO);
+ M_WAITOK);
limp->pl_refcnt = 1;
- mtx_init(&limp->pl_mtx, "plimit lock", NULL, MTX_DEF);
+ limp->pl_mtx = mtx_pool_alloc(mtxpool_sleep);
return (limp);
}
@@ -862,7 +862,7 @@ lim_free(limp)
LIM_LOCK(limp);
KASSERT(limp->pl_refcnt > 0, ("plimit refcnt underflow"));
if (--limp->pl_refcnt == 0) {
- mtx_destroy(&limp->pl_mtx);
+ LIM_UNLOCK(limp);
free((void *)limp, M_PLIMIT);
return;
}