no need for error check after MEXTMALLOC - jdolecek

This commit is contained in:
itojun 2002-11-25 08:31:58 +00:00
parent 89e8f956d1
commit a1a2fcda1e
3 changed files with 13 additions and 18 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: kern_malloc_debug.c,v 1.7 2002/08/14 15:21:31 thorpej Exp $ */
/* $NetBSD: kern_malloc_debug.c,v 1.8 2002/11/25 08:31:58 itojun Exp $ */
/*
* Copyright (c) 1999, 2000 Artur Grabowski <art@openbsd.org>
@ -56,7 +56,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: kern_malloc_debug.c,v 1.7 2002/08/14 15:21:31 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: kern_malloc_debug.c,v 1.8 2002/11/25 08:31:58 itojun Exp $");
#include <sys/param.h>
#include <sys/proc.h>
@ -80,8 +80,13 @@ __KERNEL_RCSID(0, "$NetBSD: kern_malloc_debug.c,v 1.7 2002/08/14 15:21:31 thorpe
* if any memory chunks of this type are used. It's ok to change the size
* in runtime.
*/
#if 1
int debug_malloc_type = -1;
int debug_malloc_size = -1;
#else
int debug_malloc_type = M_UVMAMAP;
int debug_malloc_size = 0;
#endif
int debug_malloc_size_lo = -1;
int debug_malloc_size_hi = -1;

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_syscalls.c,v 1.72 2002/11/25 06:32:37 itojun Exp $ */
/* $NetBSD: uipc_syscalls.c,v 1.73 2002/11/25 08:31:59 itojun Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1990, 1993
@ -36,7 +36,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.72 2002/11/25 06:32:37 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: uipc_syscalls.c,v 1.73 2002/11/25 08:31:59 itojun Exp $");
#include "opt_ktrace.h"
#include "opt_pipe.h"
@ -1035,10 +1035,6 @@ sockargs(struct mbuf **mp, const void *buf, size_t buflen, int type)
* enough external storage to hold the argument.
*/
MEXTMALLOC(m, buflen, M_WAITOK);
if ((m->m_flags & M_EXT) == 0) {
m_free(m);
return (ENOBUFS);
}
}
m->m_len = buflen;
error = copyin(buf, mtod(m, caddr_t), buflen);

View File

@ -1,4 +1,4 @@
/* $NetBSD: uipc_usrreq.c,v 1.55 2002/11/25 06:32:38 itojun Exp $ */
/* $NetBSD: uipc_usrreq.c,v 1.56 2002/11/25 08:32:00 itojun Exp $ */
/*-
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
@ -74,7 +74,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.55 2002/11/25 06:32:38 itojun Exp $");
__KERNEL_RCSID(0, "$NetBSD: uipc_usrreq.c,v 1.56 2002/11/25 08:32:00 itojun Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@ -144,11 +144,8 @@ unp_setsockaddr(unp, nam)
else
sun = &sun_noname;
nam->m_len = sun->sun_len;
if (nam->m_len > MLEN) {
if (nam->m_len > MLEN)
MEXTMALLOC(nam, nam->m_len, M_WAITOK);
if ((nam->m_flags & M_EXT) == 0)
panic("MEXTMALLOC with too big size");
}
memcpy(mtod(nam, caddr_t), sun, (size_t)nam->m_len);
}
@ -164,11 +161,8 @@ unp_setpeeraddr(unp, nam)
else
sun = &sun_noname;
nam->m_len = sun->sun_len;
if (nam->m_len > MLEN) {
if (nam->m_len > MLEN)
MEXTMALLOC(nam, nam->m_len, M_WAITOK);
if ((nam->m_flags & M_EXT) == 0)
panic("MEXTMALLOC with too big size");
}
memcpy(mtod(nam, caddr_t), sun, (size_t)nam->m_len);
}