diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-20 10:53:10 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1996-06-20 10:53:10 +0000 |
commit | 1e818041a24e6002c9ec32181f7670b29bdc323b (patch) | |
tree | 1be89419fabb6a14ba780bfde5a677dd7729769c /sys/vm/vm_kern.c | |
parent | 0b9eff8105b4d1b4eadc8fd665d40dd6c8f6f36a (diff) |
kern_malloc() can fail in canwait case if no more map space; return NULL in
that case so that callers can deal with shortage rather than deadlocking.
Diffstat (limited to 'sys/vm/vm_kern.c')
-rw-r--r-- | sys/vm/vm_kern.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/sys/vm/vm_kern.c b/sys/vm/vm_kern.c index 5b578fa3238..c5475f0d1f8 100644 --- a/sys/vm/vm_kern.c +++ b/sys/vm/vm_kern.c @@ -1,4 +1,4 @@ -/* $NetBSD: vm_kern.c,v 1.17 1995/04/10 16:53:55 mycroft Exp $ */ +/* $NetBSD: vm_kern.c,v 1.17.6.1 1996/06/13 17:21:28 cgd Exp $ */ /* * Copyright (c) 1991, 1993 @@ -297,9 +297,14 @@ kmem_malloc(map, size, canwait) vm_map_lock(map); if (vm_map_findspace(map, 0, size, &addr)) { vm_map_unlock(map); - if (canwait) /* XXX should wait */ - panic("kmem_malloc: %s too small", - map == kmem_map ? "kmem_map" : "mb_map"); + /* + * Should wait, but that makes no sense since we will + * likely never wake up unless action to free resources + * is taken by the calling subsystem. + * + * We return NULL, and if the caller was able to wait + * then they should take corrective action and retry. + */ return (0); } offset = addr - vm_map_min(kmem_map); |