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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1528804132-154948-1-git-send-email-cgxu519@gmx.com>
Date:   Tue, 12 Jun 2018 19:48:52 +0800
From:   Chengguang Xu <cgxu519@....com>
To:     tglx@...utronix.de, mingo@...hat.com, hpa@...or.com
Cc:     x86@...nel.org, linux-kernel@...r.kernel.org,
        Chengguang Xu <cgxu519@....com>
Subject: [PATCH v2] x86: remove redundant check for kmem_cache_create()

The flag 'SLAB_PANIC' implies panic when encouter failure,
So there is no need to check NULL pointer for cache creation.

Signed-off-by: Chengguang Xu <cgxu519@....com>
---
v1->v2:
- Keep return type as int instead of changing to void.

 arch/x86/mm/pgtable.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/arch/x86/mm/pgtable.c b/arch/x86/mm/pgtable.c
index 47b5951..406873d 100644
--- a/arch/x86/mm/pgtable.c
+++ b/arch/x86/mm/pgtable.c
@@ -329,9 +329,6 @@ static int __init pgd_cache_init(void)
 	 */
 	pgd_cache = kmem_cache_create("pgd_cache", PGD_SIZE, PGD_ALIGN,
 				      SLAB_PANIC, NULL);
-	if (!pgd_cache)
-		return -ENOMEM;
-
 	return 0;
 }
 core_initcall(pgd_cache_init);
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ