aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Villemoes <[email protected]>2014-08-06 16:09:38 -0700
committerLinus Torvalds <[email protected]>2014-08-06 18:01:25 -0700
commit27d555d101c820ac4b1962680bd0192993c6e4e0 (patch)
tree4c1a40359657bd3bcc36c77e4b99c1ededabec14
parent087face5265026d4fe664bdb580f4904bd10cfbf (diff)
lib: list_sort_test(): return -ENOMEM when allocation fails
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]>
-rw-r--r--lib/list_sort.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/list_sort.c b/lib/list_sort.c
index 1183fa70a44d..291412ade89a 100644
--- a/lib/list_sort.c
+++ b/lib/list_sort.c
@@ -207,7 +207,7 @@ static int __init cmp(void *priv, struct list_head *a, struct list_head *b)
static int __init list_sort_test(void)
{
- int i, count = 1, err = -EINVAL;
+ int i, count = 1, err = -ENOMEM;
struct debug_el *el;
struct list_head *cur, *tmp;
LIST_HEAD(head);
@@ -239,6 +239,7 @@ static int __init list_sort_test(void)
list_sort(NULL, &head, cmp);
+ err = -EINVAL;
for (cur = head.next; cur->next != &head; cur = cur->next) {
struct debug_el *el1;
int cmp_result;