Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/kern no need for error check after MEXTMALLOC - jdolecek
details: https://anonhg.NetBSD.org/src/rev/7a51a620e1b1
branches: trunk
changeset: 539746:7a51a620e1b1
user: itojun <itojun%NetBSD.org@localhost>
date: Mon Nov 25 08:31:58 2002 +0000
description:
no need for error check after MEXTMALLOC - jdolecek
diffstat:
sys/kern/kern_malloc_debug.c | 9 +++++++--
sys/kern/uipc_syscalls.c | 8 ++------
sys/kern/uipc_usrreq.c | 14 ++++----------
3 files changed, 13 insertions(+), 18 deletions(-)
diffs (105 lines):
diff -r 4400c71bf126 -r 7a51a620e1b1 sys/kern/kern_malloc_debug.c
--- a/sys/kern/kern_malloc_debug.c Mon Nov 25 08:07:04 2002 +0000
+++ b/sys/kern/kern_malloc_debug.c Mon Nov 25 08:31:58 2002 +0000
@@ -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@localhost>
@@ -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 @@
* 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;
diff -r 4400c71bf126 -r 7a51a620e1b1 sys/kern/uipc_syscalls.c
--- a/sys/kern/uipc_syscalls.c Mon Nov 25 08:07:04 2002 +0000
+++ b/sys/kern/uipc_syscalls.c Mon Nov 25 08:31:58 2002 +0000
@@ -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 @@
* 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);
diff -r 4400c71bf126 -r 7a51a620e1b1 sys/kern/uipc_usrreq.c
--- a/sys/kern/uipc_usrreq.c Mon Nov 25 08:07:04 2002 +0000
+++ b/sys/kern/uipc_usrreq.c Mon Nov 25 08:31:58 2002 +0000
@@ -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 @@
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 @@
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);
}
Home |
Main Index |
Thread Index |
Old Index