X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvlib%2Finit.h;h=f163ee2fb7a2bc8ec86ef4801fe4ad81564e51b7;hb=497deaf72f98dd104d9c9999a877ddd2f04c0aa6;hp=1eddbb13d5af956d20000a3be131742ccc3f9377;hpb=72d2c4f3718ba5293e9e0fa8726406ee7d9f3940;p=vpp.git 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); \ } \ }