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-power4/include/linux/list.h~list_del-debug 2003-04-22 21:43:27.000000000 -0700 +++ 25-power4-akpm/include/linux/list.h 2003-04-22 21:53:06.000000000 -0700 @@ -134,8 +134,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); } /** _