lkml.org 
[lkml]   [2017]   [Sep]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] x86:mm:return -ENOMEM if kzalloc() fails
Date
 Currently on failure the value returned from kzalloc() is -1.
It should return -ENOMEM.

Signed-off-by: Allen Pais <allen.lkml@gmail.com>
---
arch/x86/mm/kmmio.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
index afc47f5..eb74b8a 100644
--- a/arch/x86/mm/kmmio.c
+++ b/arch/x86/mm/kmmio.c
@@ -385,7 +385,7 @@ static int add_kmmio_fault_page(unsigned long addr)

f = kzalloc(sizeof(*f), GFP_ATOMIC);
if (!f)
- return -1;
+ return -ENOMEM;

f->count = 1;
f->addr = addr;
--
2.7.4
\
 
 \ /
  Last update: 2017-09-07 08:27    [W:0.040 / U:1.448 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site