lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Fri,  8 Dec 2017 22:39:34 +0100
From:   Vasyl Gomonovych <gomonovych@...il.com>
To:     rostedt@...dmis.org, mingo@...nel.org, karolherbst@...il.com,
        ppaalanen@...il.com, tglx@...utronix.de, hpa@...or.com,
        gomonovych@...il.com
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        nouveau@...ts.freedesktop.org
Subject: [PATCH] x86/mm/kmmio: Fix returned errno code

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@...il.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ