From Manfred Spraul A list_del debugging check. --- 25-akpm/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-04-05 18:46:59.874987800 -0700 +++ 25-akpm/include/linux/list.h 2004-04-05 18:46:59.877987344 -0700 @@ -158,8 +158,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; _