projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
55817d3
)
list debugging: warn when deleting a deleted entry
author
Baruch Siach
<
[email protected]
>
Tue, 10 Aug 2010 00:20:53 +0000
(17:20 -0700)
committer
Linus Torvalds
<
[email protected]
>
Tue, 10 Aug 2010 03:45:08 +0000
(20:45 -0700)
Use the magic LIST_POISON* values to detect an incorrect use of list_del
on a deleted entry. This DEBUG_LIST specific warning is easier to
understand than the generic Oops message caused by LIST_POISON
dereference.
Signed-off-by: Baruch Siach <
[email protected]
>
Cc: Dave Jones <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
lib/list_debug.c
patch
|
blob
|
history
diff --git
a/lib/list_debug.c
b/lib/list_debug.c
index 1a39f4e3ae1f1a93a8cb87cae13ce77b5c475d96..344c710d16ca427ca44c3a2c348b3593e80174a4 100644
(file)
--- a/
lib/list_debug.c
+++ b/
lib/list_debug.c
@@
-43,6
+43,12
@@
EXPORT_SYMBOL(__list_add);
*/
void list_del(struct list_head *entry)
{
+ WARN(entry->next == LIST_POISON1,
+ "list_del corruption, next is LIST_POISON1 (%p)\n",
+ LIST_POISON1);
+ WARN(entry->next != LIST_POISON1 && entry->prev == LIST_POISON2,
+ "list_del corruption, prev is LIST_POISON2 (%p)\n",
+ LIST_POISON2);
WARN(entry->prev->next != entry,
"list_del corruption. prev->next should be %p, "
"but was %p\n", entry, entry->prev->next);