From: Allen Pais <allen.lkml@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: x86@kernel.org, Allen Pais <allen.lkml@gmail.com>
Subject: [PATCH 1/1] x86:mm:return -ENOMEM if kzalloc() fails
Date: Thu, 7 Sep 2017 11:56:47 +0530 [thread overview]
Message-ID: <1504765607-23548-1-git-send-email-allen.lkml@gmail.com> (raw)
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
next reply other threads:[~2017-09-07 6:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-07 6:26 Allen Pais [this message]
2017-09-07 6:33 ` [PATCH 1/1] x86:mm:return -ENOMEM if kzalloc() fails Joe Perches
2017-09-07 6:38 ` Allen
2017-09-07 6:46 ` Joe Perches
2017-09-07 6:54 ` Allen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1504765607-23548-1-git-send-email-allen.lkml@gmail.com \
--to=allen.lkml@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox