summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2005-07-04 00:20:43 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2005-07-04 00:20:43 +0000
commit402f94f0412a0f858d5a1d983607a2bf5d73c388 (patch)
treeb00883d26e0a5aca12b76dcd78cfeed2a3de5b17
parentc3036770ec2a3094a235e288da2be801f618a278 (diff)
oops, kernel free needs two args. thanks pedro
-rw-r--r--sys/kern/kern_proc.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
index eb39f67acb6..606a303acec 100644
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kern_proc.c,v 1.26 2005/07/03 22:56:07 tedu Exp $ */
+/* $OpenBSD: kern_proc.c,v 1.27 2005/07/04 00:20:42 tedu Exp $ */
/* $NetBSD: kern_proc.c,v 1.14 1996/02/09 18:59:41 christos Exp $ */
/*
@@ -85,9 +85,11 @@ procinit()
LIST_INIT(&allproc);
LIST_INIT(&zombproc);
- pidhashtbl = hashinit(maxproc / 4, M_PROC, M_WAITOK, &pidhash);
- pgrphashtbl = hashinit(maxproc / 4, M_PROC, M_WAITOK, &pgrphash);
- uihashtbl = hashinit(maxproc / 16, M_PROC, M_WAITOK, &uihash);
+ pidhashtbl = hashinit(maxproc / 4, M_PROC, M_NOWAIT, &pidhash);
+ pgrphashtbl = hashinit(maxproc / 4, M_PROC, M_NOWAIT, &pgrphash);
+ uihashtbl = hashinit(maxproc / 16, M_PROC, M_NOWAIT, &uihash);
+ if (!pidhashtbl || !pgrphashtbl || !uihashtbl)
+ panic("procinit: malloc");
pool_init(&proc_pool, sizeof(struct proc), 0, 0, 0, "procpl",
&pool_allocator_nointr);
@@ -125,7 +127,7 @@ uid_find(uid_t uid)
if (uip->ui_uid == uid)
break;
if (uip) {
- free(nuip);
+ free(nuip, M_PROC);
return (uip);
}
bzero(nuip, sizeof(*nuip));