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:
27d555d
)
lib: list_sort_test(): add extra corruption check
author
Rasmus Villemoes
<
[email protected]
>
Wed, 6 Aug 2014 23:09:40 +0000
(16:09 -0700)
committer
Linus Torvalds
<
[email protected]
>
Thu, 7 Aug 2014 01:01:25 +0000
(18:01 -0700)
Add a check to make sure that the prev pointer of the list head points
to the last element on the list.
Signed-off-by: Rasmus Villemoes <
[email protected]
>
Cc: Artem Bityutskiy <
[email protected]
>
Cc: Don Mullis <
[email protected]
>
Cc: Dave Chinner <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
lib/list_sort.c
patch
|
blob
|
history
diff --git
a/lib/list_sort.c
b/lib/list_sort.c
index 291412ade89a7c39acc4d03705de59488b761860..fbdbc867b252dd7dd1ffaf79c1a2a58d31461d70 100644
(file)
--- a/
lib/list_sort.c
+++ b/
lib/list_sort.c
@@
-272,6
+272,11
@@
static int __init list_sort_test(void)
}
count++;
}
+ if (head.prev != cur) {
+ printk(KERN_ERR "list_sort_test: error: list is corrupted\n");
+ goto exit;
+ }
+
if (count != TEST_LIST_LEN) {
printk(KERN_ERR "list_sort_test: error: bad list length %d",