Bladeren bron

[list] Add sanity checks after list-adding functions

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 9 jaren geleden
bovenliggende
commit
28149d30f5
1 gewijzigde bestanden met toevoegingen van 4 en 0 verwijderingen
  1. 4
    0
      src/include/ipxe/list.h

+ 4
- 0
src/include/ipxe/list.h Bestand weergeven

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

Laden…
Annuleren
Opslaan