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]
Date:   Wed, 24 Nov 2021 03:08:49 +0000
From:   cgel.zte@...il.com
To:     akpm@...ux-foundation.org
Cc:     linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        chiminghao <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH] mm: Use BUG_ON instead of if condition followed by BUG

From: chiminghao <chi.minghao@....com.cn>

Fix the following coccinelle report:
./mm/memory_hotplug.c:2210:2-5:
WARNING  Use BUG_ON instead of if condition followed by BUG.

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: chiminghao <chi.minghao@....com.cn>
---
 mm/memory_hotplug.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
index 3de7933e5302..aecb12bb7513 100644
--- a/mm/memory_hotplug.c
+++ b/mm/memory_hotplug.c
@@ -2212,8 +2212,7 @@ void __remove_memory(u64 start, u64 size)
 	 * trigger BUG() if some memory is not offlined prior to calling this
 	 * function
 	 */
-	if (try_remove_memory(start, size))
-		BUG();
+	BUG_ON(try_remove_memory(start, size));
 }
 
 /*
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ