From 2d3cfcba37093d7375f5b41ea186b0736e6f8c63 Mon Sep 17 00:00:00 2001 From: thib Date: Tue, 29 Jul 2008 10:05:38 +0000 Subject: [PATCH] check for m_devget() returning NULL, increment ierror count and just return; OK mglocker@ --- sys/dev/pcmcia/if_malo.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sys/dev/pcmcia/if_malo.c b/sys/dev/pcmcia/if_malo.c index 3ae1102cb25..d8ff907f818 100644 --- a/sys/dev/pcmcia/if_malo.c +++ b/sys/dev/pcmcia/if_malo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_malo.c,v 1.62 2008/07/27 13:02:37 mglocker Exp $ */ +/* $OpenBSD: if_malo.c,v 1.63 2008/07/29 10:05:38 thib Exp $ */ /* * Copyright (c) 2007 Marcus Glocker @@ -929,6 +929,11 @@ cmalo_rx(struct malo_softc *sc) /* prepare mbuf */ m = m_devget(sc->sc_data + rxdesc->pkgoffset - ETHER_ALIGN, rxdesc->pkglen + ETHER_ALIGN, 0, ifp, NULL); + if (m == NULL) { + DPRINTF(1, "RX m_devget failed!\n"); + ifp->if_ierrors++; + return; + } m_adj(m, ETHER_ALIGN); #if NBPFILTER > 0 -- 2.20.1