[rtems-libbsd commit] if_dwc: Avoid NULL pointer access
Sebastian Huber
sebh at rtems.org
Wed Apr 1 07:16:38 UTC 2015
Module: rtems-libbsd
Branch: master
Commit: 1535c87c81b7627d34d6e7604b1c798433adc36d
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=1535c87c81b7627d34d6e7604b1c798433adc36d
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Fri Mar 27 09:48:27 2015 +0100
if_dwc: Avoid NULL pointer access
---
freebsd/sys/dev/dwc/if_dwc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/freebsd/sys/dev/dwc/if_dwc.c b/freebsd/sys/dev/dwc/if_dwc.c
index 75d4862..33240ea 100644
--- a/freebsd/sys/dev/dwc/if_dwc.c
+++ b/freebsd/sys/dev/dwc/if_dwc.c
@@ -610,7 +610,8 @@ dwc_alloc_mbufcl(struct dwc_softc *sc)
struct mbuf *m;
m = m_getcl(M_NOWAIT, MT_DATA, M_PKTHDR);
- m->m_pkthdr.len = m->m_len = m->m_ext.ext_size;
+ if (m != NULL)
+ m->m_pkthdr.len = m->m_len = m->m_ext.ext_size;
return (m);
}
More information about the vc
mailing list