linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mm/kmmio: Fix returned errno code
@ 2017-12-08 21:39 Vasyl Gomonovych
  0 siblings, 0 replies; only message in thread
From: Vasyl Gomonovych @ 2017-12-08 21:39 UTC (permalink / raw)
  To: rostedt, mingo, karolherbst, ppaalanen, tglx, hpa, gomonovych
  Cc: x86, linux-kernel, nouveau

add_kmmio_fault_page using -1 instead of the -ENOMEM
defined macro to specify kmmio_fault_page allocation failed.

Smatch tool warning:
arch/x86/mm/kmmio.c:389 add_kmmio_fault_page()
warn: returning -1 instead of -ENOMEM is sloppy

Signed-off-by: Vasyl Gomonovych <gomonovych@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 c21c2ed..9b92086b 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 -ENOMEM;
 
 	f->count = 1;
 	f->addr = addr;
-- 
1.9.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2017-12-08 21:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-12-08 21:39 [PATCH] x86/mm/kmmio: Fix returned errno code Vasyl Gomonovych

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).