Source-Changes-HG archive

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

[src/trunk]: src/sys/net revert KASSERT. It should use 'if' instead of KASSERT.



details:   https://anonhg.NetBSD.org/src/rev/ed6a9261570f
branches:  trunk
changeset: 342180:ed6a9261570f
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Fri Dec 11 04:29:24 2015 +0000

description:
revert KASSERT. It should use 'if' instead of KASSERT.

see updated(later than r1.18) kmem(9) man.

diffstat:

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

diffs (28 lines):

diff -r 757b7bd6673c -r ed6a9261570f sys/net/if_gif.c
--- a/sys/net/if_gif.c  Fri Dec 11 04:12:21 2015 +0000
+++ b/sys/net/if_gif.c  Fri Dec 11 04:29:24 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gif.c,v 1.100 2015/12/10 08:11:03 knakahara Exp $   */
+/*     $NetBSD: if_gif.c,v 1.101 2015/12/11 04:29:24 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.100 2015/12/10 08:11:03 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.101 2015/12/11 04:29:24 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -131,7 +131,8 @@
        struct gif_softc *sc;
 
        sc = kmem_zalloc(sizeof(struct gif_softc), KM_SLEEP);
-       KASSERT(sc != NULL);
+       if (sc == NULL)
+               return ENOMEM;
 
        if_initname(&sc->gif_if, ifc->ifc_name, unit);
 



Home | Main Index | Thread Index | Old Index