]> git.puffer.fish Git - matthieu/frr.git/commitdiff
lib: remove ALL_LIST_ELEMENTS dead code branch
authorDavid Lamparter <equinox@opensourcerouting.org>
Tue, 27 Nov 2012 02:21:44 +0000 (03:21 +0100)
committerDavid Lamparter <equinox@opensourcerouting.org>
Fri, 11 Jan 2013 21:09:34 +0000 (22:09 +0100)
ALL_LIST_ELEMENTS is checking node == NULL twice, which is causing a
whole slew of false positives in Coverity.  In this particular case,
addressing this in the code is reasonable; being a macro, this appears
all over the place without easy remedy.

Acked-by: Scott Feldman <sfeldma@cumulusnetworks.com>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
lib/linklist.h

index f0ae36256d12dc620f2b66764cd6478e8e892172..24a9e20698a55b94a75d3c43390cba9b045c115b 100644 (file)
@@ -90,7 +90,7 @@ extern void list_add_list (struct list *, struct list *);
 #define ALL_LIST_ELEMENTS(list,node,nextnode,data) \
   (node) = listhead(list), ((data) = NULL); \
   (node) != NULL && \
-    ((data) = listgetdata(node),(nextnode) = listnextnode(node), 1); \
+    ((data) = listgetdata(node),(nextnode) = node->next, 1); \
   (node) = (nextnode), ((data) = NULL)
 
 /* read-only list iteration macro.