diff options
| author | Manfred Spraul <[email protected]> | 2006-09-29 08:59:01 +0000 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2006-09-29 16:18:05 +0000 |
| commit | df89a864631f5d840f4873c4c03733b4206e78ea (patch) | |
| tree | ea72861bb3348ff740f0ff1e89260eb451666a5b /lib/list_debug.c | |
| parent | [PATCH] Debug variants of linked list macros (diff) | |
| download | kernel-df89a864631f5d840f4873c4c03733b4206e78ea.tar.gz kernel-df89a864631f5d840f4873c4c03733b4206e78ea.zip | |
[PATCH] list_del debug check
A list_del() debugging check. Has been in -mm for years. Dave moved
list_del() out-of-line in the debug case, so this is now suitable for
mainline.
Cc: Dave Jones <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'lib/list_debug.c')
| -rw-r--r-- | lib/list_debug.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/list_debug.c b/lib/list_debug.c index 1aae85cef92c..e80d27c97898 100644 --- a/lib/list_debug.c +++ b/lib/list_debug.c @@ -59,14 +59,17 @@ EXPORT_SYMBOL(list_add); */ void list_del(struct list_head *entry) { + BUG_ON(entry->prev->next != entry); + BUG_ON(entry->next->prev != entry); + if (unlikely(entry->prev->next != entry)) { - printk(KERN_ERR "list_del corruption. prev->next should be %p, but was %p\n", - entry, entry->prev->next); + printk(KERN_ERR "list_del corruption. prev->next should be %p, " + "but was %p\n", entry, entry->prev->next); BUG(); } if (unlikely(entry->next->prev != entry)) { - printk(KERN_ERR "list_del corruption. next->prev should be %p, but was %p\n", - entry, entry->next->prev); + printk(KERN_ERR "list_del corruption. next->prev should be %p, " + "but was %p\n", entry, entry->next->prev); BUG(); } __list_del(entry->prev, entry->next); @@ -74,4 +77,3 @@ void list_del(struct list_head *entry) entry->prev = LIST_POISON2; } EXPORT_SYMBOL(list_del); - |
