aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/lib/list_debug.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2016-02-12 14:24:37 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2016-02-12 14:24:37 +0100
commit05fd934ba585ea8c9f129f15f11327adb1f96fe3 (patch)
tree7b678c512c43419ccf484e71c84d69caee84a6da /lib/list_debug.c
parentagp/intel-gtt: Only register fake agp driver for gen1 (diff)
parentdrm/msm: remove unused variable (diff)
downloadwireguard-linux-05fd934ba585ea8c9f129f15f11327adb1f96fe3.tar.xz
wireguard-linux-05fd934ba585ea8c9f129f15f11327adb1f96fe3.zip
Merge tag 'topic/drm-misc-2016-02-12' into drm-intel-next-queued
Backmerge to get at the new encoder_mask support in atomic helpers. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Diffstat (limited to 'lib/list_debug.c')
-rw-r--r--lib/list_debug.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/list_debug.c b/lib/list_debug.c
index c24c2f7e296f..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",
@@ -37,7 +46,7 @@ void __list_add(struct list_head *new,
next->prev = new;
new->next = next;
new->prev = prev;
- prev->next = new;
+ WRITE_ONCE(prev->next, new);
}
EXPORT_SYMBOL(__list_add);