Module Name:    src
Committed By:   snj
Date:           Sat Aug 12 03:26:39 UTC 2017

Modified Files:
        src/sys/dev/pci [netbsd-7-1]: if_et.c

Log Message:
Pull up following revision(s) (requested by mrg in ticket #1470):
        sys/dev/pci/if_et.c: revision 1.15
Check for MCLGET failure in et_newbuf.
>From Ilja Van Sprundel.


To generate a diff of this commit:
cvs rdiff -u -r1.8.4.1 -r1.8.4.1.6.1 src/sys/dev/pci/if_et.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/pci/if_et.c
diff -u src/sys/dev/pci/if_et.c:1.8.4.1 src/sys/dev/pci/if_et.c:1.8.4.1.6.1
--- src/sys/dev/pci/if_et.c:1.8.4.1	Tue Aug  4 21:16:43 2015
+++ src/sys/dev/pci/if_et.c	Sat Aug 12 03:26:39 2017
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_et.c,v 1.8.4.1 2015/08/04 21:16:43 snj Exp $	*/
+/*	$NetBSD: if_et.c,v 1.8.4.1.6.1 2017/08/12 03:26:39 snj Exp $	*/
 /*	$OpenBSD: if_et.c,v 1.11 2008/06/08 06:18:07 jsg Exp $	*/
 /*
  * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.8.4.1 2015/08/04 21:16:43 snj Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_et.c,v 1.8.4.1.6.1 2017/08/12 03:26:39 snj Exp $");
 
 #include "opt_inet.h"
 #include "vlan.h"
@@ -2028,6 +2028,10 @@ et_newbuf(struct et_rxbuf_data *rbd, int
 		if (m == NULL)
 			return (ENOBUFS);
 		MCLGET(m, init ? M_WAITOK : M_DONTWAIT);
+		if ((m->m_flags & M_EXT) == 0) {
+			m_freem(m);
+			return (ENOBUFS);
+		}
 		len = MCLBYTES;
 	} else {
 		MGETHDR(m, init ? M_WAITOK : M_DONTWAIT, MT_DATA);

Reply via email to