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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YZ483gwnwTysPt0G@casper.infradead.org>
Date:   Wed, 24 Nov 2021 13:23:42 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     cgel.zte@...il.com
Cc:     akpm@...ux-foundation.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, chiminghao <chi.minghao@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH] mm: Use BUG_ON instead of if condition followed by BUG

On Wed, Nov 24, 2021 at 03:08:49AM +0000, cgel.zte@...il.com wrote:
> 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.

What coccinelle script is reporting this?

> -	if (try_remove_memory(start, size))
> -		BUG();
> +	BUG_ON(try_remove_memory(start, size));

I really, really, really do not like this.  For functions with
side-effects, this is bad style.  If it's a pure predicate, then
sure, but this is bad.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ