<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
From Manfred Spraul

A list_del debugging check.

Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
---

 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	Mon Jun 14 16:44:07 2004
+++ 25-akpm/include/linux/list.h	Mon Jun 14 16:51:27 2004
@@ -6,6 +6,7 @@
 #include &lt;linux/stddef.h&gt;
 #include &lt;linux/prefetch.h&gt;
 #include &lt;asm/system.h&gt;
+#include &lt;asm/bug.h&gt;
 
 /*
  * These are non-NULL pointers that will result in page faults
@@ -160,6 +161,8 @@ static inline void __list_del(struct lis
  */
 static inline void list_del(struct list_head *entry)
 {
+	BUG_ON(entry-&gt;prev-&gt;next != entry);
+	BUG_ON(entry-&gt;next-&gt;prev != entry);
 	__list_del(entry-&gt;prev, entry-&gt;next);
 	entry-&gt;next = LIST_POISON1;
 	entry-&gt;prev = LIST_POISON2;
_
</pre></body></html>