Module Name: src
Committed By: snj
Date: Sat Aug 5 04:53:35 UTC 2017
Modified Files:
src/sys/dev/ic [netbsd-8]: dm9000.c
Log Message:
Pull up following revision(s) (requested by spz in ticket #186):
sys/dev/ic/dm9000.c: revision 1.12
Check for MCLGET failure in dme_alloc_receive_buffer.
>From Ilja Van Sprundel.
To generate a diff of this commit:
cvs rdiff -u -r1.11 -r1.11.8.1 src/sys/dev/ic/dm9000.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/dm9000.c
diff -u src/sys/dev/ic/dm9000.c:1.11 src/sys/dev/ic/dm9000.c:1.11.8.1
--- src/sys/dev/ic/dm9000.c:1.11 Thu Dec 15 09:28:05 2016
+++ src/sys/dev/ic/dm9000.c Sat Aug 5 04:53:34 2017
@@ -1,4 +1,4 @@
-/* $NetBSD: dm9000.c,v 1.11 2016/12/15 09:28:05 ozaki-r Exp $ */
+/* $NetBSD: dm9000.c,v 1.11.8.1 2017/08/05 04:53:34 snj Exp $ */
/*
* Copyright (c) 2009 Paul Fleischer
@@ -1226,8 +1226,13 @@ dme_alloc_receive_buffer(struct ifnet *i
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);