summaryrefslogtreecommitdiff
path: root/lib/list_debug.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@kernel.org>2016-02-08 12:13:22 +0100
committerIngo Molnar <mingo@kernel.org>2016-02-08 12:13:22 +0100
commitb349e9a916772e867d0f9246d2978799897b2495 (patch)
treebaebdc1a0c1176198518ba6991fbf42ce4614910 /lib/list_debug.c
parent7c360572b430a0e9757bafc0c20f26c920f2a07f (diff)
parent59fd1214561921343305a0e9dc218bf3d40068f3 (diff)
Merge branch 'x86/urgent' into x86/mm, to pick up dependent fix
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'lib/list_debug.c')
-rw-r--r--lib/list_debug.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/list_debug.c b/lib/list_debug.c
index 3859bf63561c..3345a089ef7b 100644
--- a/lib/list_debug.c
+++ b/lib/list_debug.c
@@ -12,6 +12,13 @@
#include <linux/kernel.h>
#include <linux/rculist.h>
+static struct list_head force_poison;
+void list_force_poison(struct list_head *entry)
+{
+ entry->next = &force_poison;
+ entry->prev = &force_poison;
+}
+
/*
* Insert a new entry between two known consecutive entries.
*
@@ -23,6 +30,8 @@ void __list_add(struct list_head *new,
struct list_head *prev,
struct list_head *next)
{
+ WARN(new->next == &force_poison || new->prev == &force_poison,
+ "list_add attempted on force-poisoned entry\n");
WARN(next->prev != prev,
"list_add corruption. next->prev should be "
"prev (%p), but was %p. (next=%p).\n",