Source-Changes-HG archive

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

[src/netbsd-7-1]: src/sys/dev/ic Pull up following revision(s) (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/51e9449d20ea
branches:  netbsd-7-1
changeset: 800769:51e9449d20ea
user:      snj <snj%NetBSD.org@localhost>
date:      Sat Aug 12 03:44:39 2017 +0000

description:
Pull up following revision(s) (requested by mrg in ticket #1473):
        sys/dev/ic/dm9000.c: revision 1.12
Check for MCLGET failure in dme_alloc_receive_buffer.
>From Ilja Van Sprundel.

diffstat:

 sys/dev/ic/dm9000.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (24 lines):

diff -r 13a67436bc2a -r 51e9449d20ea sys/dev/ic/dm9000.c
--- a/sys/dev/ic/dm9000.c       Sat Aug 12 03:42:33 2017 +0000
+++ b/sys/dev/ic/dm9000.c       Sat Aug 12 03:44:39 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: dm9000.c,v 1.4.22.1 2015/01/02 20:24:14 martin Exp $   */
+/*     $NetBSD: dm9000.c,v 1.4.22.1.6.1 2017/08/12 03:44:39 snj Exp $  */
 
 /*
  * Copyright (c) 2009 Paul Fleischer
@@ -1122,8 +1122,13 @@
                sizeof(struct ether_header);
        /* All our frames have the CRC attached */
        m->m_flags |= M_HASFCS;
-       if (m->m_pkthdr.len + pad > MHLEN )
+       if (m->m_pkthdr.len + pad > MHLEN) {
                MCLGET(m, M_DONTWAIT);
+               if ((m->m_flags & M_EXT) == 0) {
+                       m_freem(m);
+                       return NULL;
+               }
+       }
 
        m->m_data += pad;
        m->m_len = frame_length + (frame_length % sc->sc_data_width);



Home | Main Index | Thread Index | Old Index