diff options
author | bp <bp@FreeBSD.org> | 2001-01-31 04:50:20 +0000 |
---|---|---|
committer | bp <bp@FreeBSD.org> | 2001-01-31 04:50:20 +0000 |
commit | 076c2e70fda136ef48c7da93fc16bf7d4c7cb0cf (patch) | |
tree | 9d890169bad4aa8fae0892a28852ca0f5723e2d8 /sys | |
parent | 6150a5017458fd74462db58efb154b09f995f8f9 (diff) | |
download | FreeBSD-src-076c2e70fda136ef48c7da93fc16bf7d4c7cb0cf.zip FreeBSD-src-076c2e70fda136ef48c7da93fc16bf7d4c7cb0cf.tar.gz |
Let M_PANIC go back to the private tree as its intention isn't understood well
for now.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_malloc.c | 8 | ||||
-rw-r--r-- | sys/net/if_loop.c | 3 | ||||
-rw-r--r-- | sys/sys/malloc.h | 1 |
3 files changed, 3 insertions, 9 deletions
diff --git a/sys/kern/kern_malloc.c b/sys/kern/kern_malloc.c index 2186007..089d867 100644 --- a/sys/kern/kern_malloc.c +++ b/sys/kern/kern_malloc.c @@ -164,8 +164,7 @@ malloc(size, type, flags) if (flags & M_NOWAIT) { splx(s); mtx_exit(&malloc_mtx, MTX_DEF); - va = NULL; - goto checkpanic; + return ((void *) NULL); } if (ksp->ks_limblocks < 65535) ksp->ks_limblocks++; @@ -189,7 +188,7 @@ malloc(size, type, flags) if (va == NULL) { splx(s); - goto checkpanic; + return ((void *) NULL); } /* * Enter malloc_mtx after the error check to avoid having to @@ -283,9 +282,6 @@ out: /* XXX: Do idle pre-zeroing. */ if (va != NULL && (flags & M_ZERO)) bzero(va, size); -checkpanic: - if (va == NULL && (flags & M_PANIC)) - panic("malloc: failed to allocate %ld bytes", size); return ((void *) va); } diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c index 20bad44..105b8dd 100644 --- a/sys/net/if_loop.c +++ b/sys/net/if_loop.c @@ -120,8 +120,7 @@ locreate(int unit) { struct lo_softc *sc; - MALLOC(sc, struct lo_softc *, sizeof(*sc), M_LO, - M_WAITOK | M_ZERO | M_PANIC); + MALLOC(sc, struct lo_softc *, sizeof(*sc), M_LO, M_WAITOK | M_ZERO); sc->sc_if.if_name = "lo"; sc->sc_if.if_unit = unit; diff --git a/sys/sys/malloc.h b/sys/sys/malloc.h index 3d59271..935ec3e 100644 --- a/sys/sys/malloc.h +++ b/sys/sys/malloc.h @@ -47,7 +47,6 @@ #define M_USE_RESERVE 0x0002 /* can alloc out of reserve memory */ #define M_ASLEEP 0x0004 /* async sleep on failure */ #define M_ZERO 0x0008 /* bzero the allocation */ -#define M_PANIC 0x0010 /* panic if allocation failed */ #define M_MAGIC 877983977 /* time when first defined :-) */ |