[rtems-libbsd commit] NETISR(9): Fix NULL pointer access

Sebastian Huber sebh at rtems.org
Wed Nov 13 13:04:09 UTC 2013


Module:    rtems-libbsd
Branch:    master
Commit:    760e894d54b5aadb204fa221e532ae49b8f10a86
Changeset: http://git.rtems.org/rtems-libbsd/commit/?id=760e894d54b5aadb204fa221e532ae49b8f10a86

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Tue Nov 12 09:36:18 2013 +0100

NETISR(9): Fix NULL pointer access

---

 freebsd/sys/net/netisr.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/freebsd/sys/net/netisr.c b/freebsd/sys/net/netisr.c
index c8a4d7b..8bd4d08 100644
--- a/freebsd/sys/net/netisr.c
+++ b/freebsd/sys/net/netisr.c
@@ -1042,7 +1042,11 @@ netisr_dispatch_src(u_int proto, uintptr_t source, struct mbuf *m)
 	 * to always being forced to directly dispatch.
 	 */
 	if (dispatch_policy == NETISR_DISPATCH_DIRECT) {
+#ifndef __rtems__
 		nwsp = DPCPU_PTR(nws);
+#else /* __rtems__ */
+		nwsp = &rtems_bsd_nws;
+#endif /* __rtems__ */
 		npwp = &nwsp->nws_work[proto];
 		npwp->nw_dispatched++;
 		npwp->nw_handled++;
@@ -1071,7 +1075,11 @@ netisr_dispatch_src(u_int proto, uintptr_t source, struct mbuf *m)
 	KASSERT(!CPU_ABSENT(cpuid), ("%s: CPU %u absent", __func__, cpuid));
 	if (cpuid != curcpu)
 		goto queue_fallback;
+#ifndef __rtems__
 	nwsp = DPCPU_PTR(nws);
+#else /* __rtems__ */
+	nwsp = &rtems_bsd_nws;
+#endif /* __rtems__ */
 	npwp = &nwsp->nws_work[proto];
 
 	/*-




More information about the vc mailing list