From: Rasmus Villemoes Date: Wed, 6 Aug 2014 23:09:38 +0000 (-0700) Subject: lib: list_sort_test(): return -ENOMEM when allocation fails X-Git-Tag: submit/tizen/20160607.132125~4147^2~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27d555d101c820ac4b1962680bd0192993c6e4e0;p=sdk%2Femulator%2Femulator-kernel.git lib: list_sort_test(): return -ENOMEM when allocation fails Signed-off-by: Rasmus Villemoes Cc: Artem Bityutskiy Cc: Don Mullis Cc: Dave Chinner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/lib/list_sort.c b/lib/list_sort.c index 1183fa7..291412a 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;