Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/net kmem_zalloc(, KM_SLEEP) must not return NULL.



details:   https://anonhg.NetBSD.org/src/rev/349c337b2740
branches:  trunk
changeset: 812300:349c337b2740
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Thu Dec 10 08:11:03 2015 +0000

description:
kmem_zalloc(, KM_SLEEP) must not return NULL.

diffstat:

 sys/net/if_gif.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 6f2ab5cb03dc -r 349c337b2740 sys/net/if_gif.c
--- a/sys/net/if_gif.c  Thu Dec 10 05:33:28 2015 +0000
+++ b/sys/net/if_gif.c  Thu Dec 10 08:11:03 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gif.c,v 1.99 2015/12/10 01:20:12 knakahara Exp $    */
+/*     $NetBSD: if_gif.c,v 1.100 2015/12/10 08:11:03 knakahara Exp $   */
 /*     $KAME: if_gif.c,v 1.76 2001/08/20 02:01:02 kjc Exp $    */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.99 2015/12/10 01:20:12 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.100 2015/12/10 08:11:03 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -131,8 +131,7 @@
        struct gif_softc *sc;
 
        sc = kmem_zalloc(sizeof(struct gif_softc), KM_SLEEP);
-       if (sc == NULL)
-               return ENOMEM;
+       KASSERT(sc != NULL);
 
        if_initname(&sc->gif_if, ifc->ifc_name, unit);
 



Home | Main Index | Thread Index | Old Index