lkml.org 
[lkml]   [2014]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/2] lib: list_sort_test(): Return -ENOMEM when allocation fails
Date
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
lib/list_sort.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)

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;
--
1.9.2


\
 
 \ /
  Last update: 2014-06-21 02:21    [W:0.058 / U:0.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site