From Manfred Spraul A list_del debugging check. include/linux/list.h | 3 +++ 1 files changed, 3 insertions(+) diff -puN include/linux/list.h~list_del-debug include/linux/list.h --- 25/include/linux/list.h~list_del-debug 2004-01-01 13:46:51.000000000 -0800 +++ 25-akpm/include/linux/list.h 2004-01-01 13:46:51.000000000 -0800 @@ -142,8 +142,11 @@ static inline void __list_del(struct lis * Note: list_empty on entry does not return true after this, the entry is * in an undefined state. */ +#include /* BUG_ON */ static inline void list_del(struct list_head *entry) { + BUG_ON(entry->prev->next != entry); + BUG_ON(entry->next->prev != entry); __list_del(entry->prev, entry->next); entry->next = LIST_POISON1; entry->prev = LIST_POISON2; _