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>] [day] [month] [year] [list]
Message-ID: <20171013170917.GA144590@debian>
Date:   Fri, 13 Oct 2017 13:09:17 -0400
From:   Tim Hansen <devtimhansen@...il.com>
To:     sagi@...mberg.me
Cc:     mingo@...nel.org, neilb@...e.com, devtimhansen@...il.com,
        alexander.levin@....verizon.com, thumshirn@...e.de,
        linux-kernel@...r.kernel.org
Subject: [PATCH] kernel/softirq: use BUG_ON conditional instead of BUG in
 softirq.

Fix BUG() usage to BUG_ON(conditional) usage in softirq.

Found with make coccicheck M=kernel/ on linux-next tag next-20171012.

Signed-off-by: Tim Hansen <devtimhansen@...il.com>
---
 kernel/softirq.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 4e09821..3da3f12 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -513,9 +513,8 @@ static __latent_entropy void tasklet_action(struct softirq_action *a)
 
 		if (tasklet_trylock(t)) {
 			if (!atomic_read(&t->count)) {
-				if (!test_and_clear_bit(TASKLET_STATE_SCHED,
-							&t->state))
-					BUG();
+				BUG_ON(!test_and_clear_bit(TASKLET_STATE_SCHED,
+							&t->state));
 				t->func(t->data);
 				tasklet_unlock(t);
 				continue;
@@ -549,9 +548,8 @@ static __latent_entropy void tasklet_hi_action(struct softirq_action *a)
 
 		if (tasklet_trylock(t)) {
 			if (!atomic_read(&t->count)) {
-				if (!test_and_clear_bit(TASKLET_STATE_SCHED,
-							&t->state))
-					BUG();
+				BUG_ON(!test_and_clear_bit(TASKLET_STATE_SCHED,
+							&t->state));
 				t->func(t->data);
 				tasklet_unlock(t);
 				continue;
-- 
2.1.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ