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>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1566477146-32484-1-git-send-email-cai@lca.pw>
Date:   Thu, 22 Aug 2019 08:32:26 -0400
From:   Qian Cai <cai@....pw>
To:     tglx@...utronix.de, mingo@...hat.com, hpa@...or.com
Cc:     bhe@...hat.com, x86@...nel.org, linux-kernel@...r.kernel.org,
        Qian Cai <cai@....pw>
Subject: [PATCH] x86/kaslr: remove useless code in mem_avoid_memmap

MAX_MEMMAP_REGIONS is a macro that equal to 4. "i" is static local
variable that default to 0. The comparison "i >= MAX_MEMMAP_REGIONS"
will always be false.

Signed-off-by: Qian Cai <cai@....pw>
---
 arch/x86/boot/compressed/kaslr.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/boot/compressed/kaslr.c b/arch/x86/boot/compressed/kaslr.c
index 2e53c056ba20..a4a5a88edb94 100644
--- a/arch/x86/boot/compressed/kaslr.c
+++ b/arch/x86/boot/compressed/kaslr.c
@@ -176,9 +176,6 @@ static void mem_avoid_memmap(char *str)
 {
 	static int i;
 
-	if (i >= MAX_MEMMAP_REGIONS)
-		return;
-
 	while (str && (i < MAX_MEMMAP_REGIONS)) {
 		int rc;
 		unsigned long long start, size;
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ