X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fvppinfra%2Fdlist.h;h=d28500dc49fab5c5e6caa5c034000219d8334489;hb=aaf64a263f036c0e98c0ea954c85cfd620abad06;hp=7d09b2bbc7e32d5997e761924fcb90841478de6b;hpb=7cd468a3d7dee7d6c92f69a0bb7061ae208ec727;p=vpp.git diff --git a/src/vppinfra/dlist.h b/src/vppinfra/dlist.h index 7d09b2bbc7e..d28500dc49f 100644 --- a/src/vppinfra/dlist.h +++ b/src/vppinfra/dlist.h @@ -36,7 +36,7 @@ static inline void clib_dlist_init (dlist_elt_t * pool, u32 index) { dlist_elt_t *head = pool_elt_at_index (pool, index); - memset (head, 0xFF, sizeof (*head)); + clib_memset (head, 0xFF, sizeof (*head)); } static inline void @@ -121,7 +121,7 @@ clib_dlist_remove_head (dlist_elt_t * pool, u32 head_index) ASSERT (head->value == ~0); - if (head->next == ~0) + if (head->next == ~0 || (head->next == head_index)) return ~0; rv = head->next;