summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Morton <akpm@zip.com.au>2002-06-02 03:21:53 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-06-02 03:21:53 -0700
commitb9a78e5991e18eb4c5f93d2d58e19f1708528dae (patch)
treeaa49317dd91a7d9398008aedc39570252d99c0ec /include
parent123d67424aed4a1cf024a1663e9e6ad5b9a1e756 (diff)
[PATCH] list_head debugging
A common and very subtle bug is to use list_heads which aren't on any lists. It causes kernel memory corruption which is observed long after the offending code has executed. The patch nulls out the dangling pointers so we get a nice oops at the site of the buggy code.
Diffstat (limited to 'include')
-rw-r--r--include/linux/list.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/list.h b/include/linux/list.h
index 99da4ab62ec2..6331739453a0 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -94,6 +94,8 @@ static __inline__ void __list_del(struct list_head * prev,
static __inline__ void list_del(struct list_head *entry)
{
__list_del(entry->prev, entry->next);
+ entry->next = NULL;
+ entry->prev = NULL;
}
/**