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:   Sun, 22 Aug 2021 18:51:10 -0700
From:   CGEL <cgel.zte@...il.com>
To:     "Gustavo A . R . Silva" <gustavoars@...nel.org>
Cc:     Sergei Trofimovich <slyfox@...too.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        linux-ia64@...r.kernel.org, linux-kernel@...r.kernel.org,
        Jing Yangyang <jing.yangyang@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH linux-next] arch/ia64/kernel/module.c: fix bugon.cocci warnings

From: Jing Yangyang <jing.yangyang@....com.cn>

Use BUG_ON instead of a if condition followed by BUG.

Generated by: scripts/coccinelle/misc/bugon.cocci

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Jing Yangyang <jing.yangyang@....com.cn>
---
 arch/ia64/kernel/module.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/arch/ia64/kernel/module.c b/arch/ia64/kernel/module.c
index 2cba53c..f199378 100644
--- a/arch/ia64/kernel/module.c
+++ b/arch/ia64/kernel/module.c
@@ -560,8 +560,7 @@ struct plt_entry {
 	while (plt->bundle[0][0]) {
 		if (plt_target(plt) == target_ip)
 			goto found;
-		if (++plt >= plt_end)
-			BUG();
+		BUG_ON(++plt >= plt_end);
 	}
 	*plt = ia64_plt_template;
 	if (!patch_plt(mod, plt, target_ip, target_gp)) {
@@ -605,8 +604,7 @@ struct plt_entry {
 	while (fdesc->ip) {
 		if (fdesc->ip == value)
 			return (uint64_t)fdesc;
-		if ((uint64_t) ++fdesc >= mod->arch.opd->sh_addr + mod->arch.opd->sh_size)
-			BUG();
+		BUG_ON((uint64_t) ++fdesc >= mod->arch.opd->sh_addr + mod->arch.opd->sh_size);
 	}
 
 	/* Create new one */
-- 
1.8.3.1


Powered by blists - more mailing lists