Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/sunxi Another missing NULL-check.



details:   https://anonhg.NetBSD.org/src/rev/6f7470e9392d
branches:  trunk
changeset: 829786:6f7470e9392d
user:      maxv <maxv%NetBSD.org@localhost>
date:      Mon Feb 12 17:04:58 2018 +0000

description:
Another missing NULL-check.

diffstat:

 sys/arch/arm/sunxi/sun4i_emac.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r d76b8ac1bab6 -r 6f7470e9392d sys/arch/arm/sunxi/sun4i_emac.c
--- a/sys/arch/arm/sunxi/sun4i_emac.c   Mon Feb 12 17:01:22 2018 +0000
+++ b/sys/arch/arm/sunxi/sun4i_emac.c   Mon Feb 12 17:04:58 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sun4i_emac.c,v 1.2 2017/11/30 18:29:25 jmcneill Exp $ */
+/* $NetBSD: sun4i_emac.c,v 1.3 2018/02/12 17:04:58 maxv Exp $ */
 
 /*-
  * Copyright (c) 2013-2017 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 
-__KERNEL_RCSID(1, "$NetBSD: sun4i_emac.c,v 1.2 2017/11/30 18:29:25 jmcneill Exp $");
+__KERNEL_RCSID(1, "$NetBSD: sun4i_emac.c,v 1.3 2018/02/12 17:04:58 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -509,6 +509,9 @@
 {
        struct mbuf *m = m_gethdr(M_DONTWAIT, MT_DATA);
 
+       if (m == NULL) {
+               return NULL;
+       }
        if (rxlen + 2 > MHLEN) {
                MCLGET(m, M_DONTWAIT);
                if ((m->m_flags & M_EXT) == 0) {



Home | Main Index | Thread Index | Old Index