summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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));