summaryrefslogtreecommitdiffstats
path: root/src/vlib
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib')
-rw-r--r--src/vlib/init.h20
1 files changed, 11 insertions, 9 deletions
diff --git a/src/vlib/init.h b/src/vlib/init.h
index 1eddbb13d5a..f163ee2fb7a 100644
--- a/src/vlib/init.h
+++ b/src/vlib/init.h
@@ -81,20 +81,22 @@ typedef struct vlib_config_function_runtime_t
#define VLIB_REMOVE_FROM_LINKED_LIST(first,p,next) \
{ \
+ ASSERT (first); \
if (first == p) \
first = (p)->next; \
else \
{ \
__typeof__ (p) current = first; \
- while (current->next) \
- { \
- if (current->next == p) \
- { \
- current->next = current->next->next; \
- break; \
- } \
- current = current->next; \
- } \
+ while (current->next) \
+ { \
+ if (current->next == p) \
+ { \
+ current->next = current->next->next; \
+ break; \
+ } \
+ current = current->next; \
+ } \
+ ASSERT (current); \
} \
}