lkml.org 
[lkml]   [2020]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] x86/mm/kmmio: correctly handle kzalloc return
Date
Replacing return value -1 to error code

Signed-off-by: Mugilraj Dhavachelvan <dmugil2000@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 be020a7bc414..15430520c232 100644
--- a/arch/x86/mm/kmmio.c
+++ b/arch/x86/mm/kmmio.c
@@ -386,7 +386,7 @@ static int add_kmmio_fault_page(unsigned long addr)

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

f->count = 1;
f->addr = addr;
--
2.25.1
\
 
 \ /
  Last update: 2020-10-20 10:45    [W:0.036 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site