summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/list.h
diff options
context:
space:
mode:
authorMichael Brown2014-12-09 14:12:01 +0100
committerMichael Brown2014-12-12 11:18:03 +0100
commit28149d30f56113f1047a7a348a67bd3e854fe4c0 (patch)
tree1058dd60d4032ce4401f42eba820e3b57ce314df /src/include/ipxe/list.h
parent[libc] Add ASSERTED macro to test if any assertion has triggered (diff)
downloadipxe-28149d30f56113f1047a7a348a67bd3e854fe4c0.tar.gz
ipxe-28149d30f56113f1047a7a348a67bd3e854fe4c0.tar.xz
ipxe-28149d30f56113f1047a7a348a67bd3e854fe4c0.zip
[list] Add sanity checks after list-adding functions
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/list.h')
-rw-r--r--src/include/ipxe/list.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/include/ipxe/list.h b/src/include/ipxe/list.h
index 0d097307..581ec980 100644
--- a/src/include/ipxe/list.h
+++ b/src/include/ipxe/list.h
@@ -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 ) {