Message ID | CAPwdgqgBpKDtGDcMLvqSRH3aLW5GzeNEm7nEWCM3owdfOx0LsQ@mail.gmail.com |
---|---|
State | Accepted |
Headers | show |
On Fri, Oct 02, 2015 at 01:23:31PM +0200, Mauricio Vásquez wrote: > The definition of the INIT_CONTAINER macro initializes ITER to NULL, > it will cause a segmentation fault when it is deferenced on > (ITER)->MEMBER.next, then, I changed it to the ASSIGN_CONTAINER macro that > does not initialize ITER. > > Signed-off-by: Mauricio Vasquez B <mauricio.vasquezbernal@studenti.polito.it > > Applied, thanks!
diff --git a/lib/list.h b/lib/list.h index 5ad54b8..db4a613 100644 --- a/lib/list.h +++ b/lib/list.h @@ -62,7 +62,7 @@ static inline bool list_is_short(const struct ovs_list *); &(ITER)->MEMBER != (LIST); \ ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER)) #define LIST_FOR_EACH_CONTINUE(ITER, MEMBER, LIST) \ - for (INIT_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER); \ + for (ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER); \ &(ITER)->MEMBER != (LIST); \ ASSIGN_CONTAINER(ITER, (ITER)->MEMBER.next, MEMBER)) #define LIST_FOR_EACH_REVERSE(ITER, MEMBER, LIST) \