diff --git a/src/utils/list.h b/src/utils/list.h index 688113095..ee2f48569 100644 --- a/src/utils/list.h +++ b/src/utils/list.h @@ -17,6 +17,8 @@ struct dl_list { struct dl_list *prev; }; +#define DL_LIST_HEAD_INIT(l) { &(l), &(l) } + static inline void dl_list_init(struct dl_list *list) { list->next = list; diff --git a/src/utils/os_unix.c b/src/utils/os_unix.c index 86fbd0aed..e0c1125d5 100644 --- a/src/utils/os_unix.c +++ b/src/utils/os_unix.c @@ -26,7 +26,7 @@ #include "trace.h" #include "list.h" -static struct dl_list alloc_list; +static struct dl_list alloc_list = DL_LIST_HEAD_INIT(alloc_list); #define ALLOC_MAGIC 0xa84ef1b2 #define FREED_MAGIC 0x67fd487a @@ -321,9 +321,6 @@ int os_program_init(void) capset(&header, &cap); #endif /* ANDROID */ -#ifdef WPA_TRACE - dl_list_init(&alloc_list); -#endif /* WPA_TRACE */ return 0; }