Browse Source

[list] Add sanity checks after list-adding functions

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 10 years ago
parent
commit
28149d30f5
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      src/include/ipxe/list.h

+ 4
- 0
src/include/ipxe/list.h View File

69
 #define list_add( new, head ) do {				\
69
 #define list_add( new, head ) do {				\
70
 	list_check ( (head) );					\
70
 	list_check ( (head) );					\
71
 	extern_list_add ( (new), (head) );			\
71
 	extern_list_add ( (new), (head) );			\
72
+	list_check ( (head) );					\
73
+	list_check ( (new) );					\
72
 	} while ( 0 )
74
 	} while ( 0 )
73
 static inline void inline_list_add ( struct list_head *new,
75
 static inline void inline_list_add ( struct list_head *new,
74
 				     struct list_head *head ) {
76
 				     struct list_head *head ) {
91
 #define list_add_tail( new, head ) do {				\
93
 #define list_add_tail( new, head ) do {				\
92
 	list_check ( (head) );					\
94
 	list_check ( (head) );					\
93
 	extern_list_add_tail ( (new), (head) );			\
95
 	extern_list_add_tail ( (new), (head) );			\
96
+	list_check ( (head) );					\
97
+	list_check ( (new) );					\
94
 	} while ( 0 )
98
 	} while ( 0 )
95
 static inline void inline_list_add_tail ( struct list_head *new,
99
 static inline void inline_list_add_tail ( struct list_head *new,
96
 					  struct list_head *head ) {
100
 					  struct list_head *head ) {

Loading…
Cancel
Save