Source-Changes-HG archive

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

[src/trunk]: src/sys/net add NULL check



details:   https://anonhg.NetBSD.org/src/rev/7104aef16dc4
branches:  trunk
changeset: 342155:7104aef16dc4
user:      knakahara <knakahara%NetBSD.org@localhost>
date:      Thu Dec 10 01:20:12 2015 +0000

description:
add NULL check

diffstat:

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

diffs (27 lines):

diff -r 16869257e45a -r 7104aef16dc4 sys/net/if_gif.c
--- a/sys/net/if_gif.c  Wed Dec 09 18:25:32 2015 +0000
+++ b/sys/net/if_gif.c  Thu Dec 10 01:20:12 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_gif.c,v 1.98 2015/12/09 05:56:24 knakahara Exp $    */
+/*     $NetBSD: if_gif.c,v 1.99 2015/12/10 01:20:12 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.98 2015/12/09 05:56:24 knakahara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_gif.c,v 1.99 2015/12/10 01:20:12 knakahara Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -131,6 +131,8 @@
        struct gif_softc *sc;
 
        sc = kmem_zalloc(sizeof(struct gif_softc), KM_SLEEP);
+       if (sc == NULL)
+               return ENOMEM;
 
        if_initname(&sc->gif_if, ifc->ifc_name, unit);
 



Home | Main Index | Thread Index | Old Index