public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] x86:mm:return -ENOMEM if kzalloc() fails
@ 2017-09-07  6:26 Allen Pais
  2017-09-07  6:33 ` Joe Perches
  0 siblings, 1 reply; 5+ messages in thread
From: Allen Pais @ 2017-09-07  6:26 UTC (permalink / raw)
  To: linux-kernel; +Cc: x86, Allen Pais

 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-09-07  6:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-09-07  6:26 [PATCH 1/1] x86:mm:return -ENOMEM if kzalloc() fails Allen Pais
2017-09-07  6:33 ` Joe Perches
2017-09-07  6:38   ` Allen
2017-09-07  6:46     ` Joe Perches
2017-09-07  6:54       ` Allen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox