[rtems commit] score: Assert proper node size

Sebastian Huber sebh at rtems.org
Wed Jun 24 12:24:52 UTC 2015


Module:    rtems
Branch:    master
Commit:    a3fc33f8fafd4dc262c76efe0bc4972c2e820c9b
Changeset: http://git.rtems.org/rtems/commit/?id=a3fc33f8fafd4dc262c76efe0bc4972c2e820c9b

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Wed Jun 24 13:36:40 2015 +0200

score: Assert proper node size

---

 cpukit/score/src/chain.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/cpukit/score/src/chain.c b/cpukit/score/src/chain.c
index f3722fa..7f7af71 100644
--- a/cpukit/score/src/chain.c
+++ b/cpukit/score/src/chain.c
@@ -19,10 +19,9 @@
 #include "config.h"
 #endif
 
-#include <rtems/system.h>
-#include <rtems/score/address.h>
 #include <rtems/score/chainimpl.h>
-#include <rtems/score/isr.h>
+#include <rtems/score/address.h>
+#include <rtems/score/assert.h>
 
 void _Chain_Initialize(
   Chain_Control *the_chain,
@@ -37,6 +36,8 @@ void _Chain_Initialize(
   Chain_Node *current = head;
   Chain_Node *next = starting_address;
 
+  _Assert( node_size >= sizeof( *next ) );
+
   head->previous = NULL;
 
   while ( count-- ) {



More information about the vc mailing list