[rtems-libbsd commit] mutex: Avoid NULL pointer access in panic()

Sebastian Huber sebh at rtems.org
Thu Nov 15 08:19:03 UTC 2018


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

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Nov 15 09:18:18 2018 +0100

mutex: Avoid NULL pointer access in panic()

---

 rtemsbsd/include/machine/rtems-bsd-muteximpl.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/rtemsbsd/include/machine/rtems-bsd-muteximpl.h b/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
index c947e2b..b362e52 100644
--- a/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
+++ b/rtemsbsd/include/machine/rtems-bsd-muteximpl.h
@@ -201,7 +201,8 @@ rtems_bsd_mutex_unlock(rtems_bsd_mutex *m)
 		rtems_bsd_mutex_release(m, isr_level, &queue_context);
 		panic("mutex unlock: %s: owner 0x%08" PRIx32
 		    " != executing 0x%08" PRIx32 "\n", m->queue.Queue.name,
-		    owner->Object.id, executing->Object.id);
+		    owner != NULL ? owner->Object.id : 0,
+		    executing->Object.id);
 	}
 
 	if (__predict_true(nest_level == 0)) {




More information about the vc mailing list