]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[list] Add sanity checks after list-adding functions
authorMichael Brown <mcb30@ipxe.org>
Tue, 9 Dec 2014 13:12:01 +0000 (13:12 +0000)
committerMichael Brown <mcb30@ipxe.org>
Fri, 12 Dec 2014 10:18:03 +0000 (10:18 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/include/ipxe/list.h

index 0d0973077e88efc803f6b40dbe7f160e21172453..581ec9806101900cd04adbf793725e6dc9f80217 100644 (file)
@@ -69,6 +69,8 @@ struct list_head {
 #define list_add( new, head ) do {                             \
        list_check ( (head) );                                  \
        extern_list_add ( (new), (head) );                      \
+       list_check ( (head) );                                  \
+       list_check ( (new) );                                   \
        } while ( 0 )
 static inline void inline_list_add ( struct list_head *new,
                                     struct list_head *head ) {
@@ -91,6 +93,8 @@ extern void extern_list_add ( struct list_head *new,
 #define list_add_tail( new, head ) do {                                \
        list_check ( (head) );                                  \
        extern_list_add_tail ( (new), (head) );                 \
+       list_check ( (head) );                                  \
+       list_check ( (new) );                                   \
        } while ( 0 )
 static inline void inline_list_add_tail ( struct list_head *new,
                                          struct list_head *head ) {