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: <20180224075835.11618-2-quytelda@tamalin.org>
Date:   Fri, 23 Feb 2018 23:58:33 -0800
From:   Quytelda Kahja <quytelda@...alin.org>
To:     gregkh@...uxfoundation.org, christian.gromm@...rochip.com
Cc:     Michael.Fabry@...rochip.com, chris@...ineersdelight.de,
        devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
        Quytelda Kahja <quytelda@...alin.org>
Subject: [PATCH 2/4] staging: most: Replace calls to BUG_ON() with WARN_ONCE() and return.

Replace calls to BUG_ON() used to check for NULL pointers with WARN_ONCE()
followed by a return.

Signed-off-by: Quytelda Kahja <quytelda@...alin.org>
---
 drivers/staging/most/core.c | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/most/core.c b/drivers/staging/most/core.c
index 18157dd80324..3f65390a6e17 100644
--- a/drivers/staging/most/core.c
+++ b/drivers/staging/most/core.c
@@ -916,7 +916,11 @@ static void arm_mbo(struct mbo *mbo)
 	unsigned long flags;
 	struct most_channel *c;
 
-	BUG_ON((!mbo) || (!mbo->context));
+	if (WARN_ONCE(!mbo || !mbo->context,
+		      "Bad mbo or missing channel reference.\n")) {
+		return;
+	}
+
 	c = mbo->context;
 
 	if (c->is_poisoned) {
@@ -1001,7 +1005,7 @@ static int arm_mbo_chain(struct most_channel *c, int dir,
 void most_submit_mbo(struct mbo *mbo)
 {
 	if (WARN_ONCE(!mbo || !mbo->context,
-		      "bad mbo or missing channel reference\n"))
+		      "Bad mbo or missing channel reference.\n"))
 		return;
 
 	nq_hdm_mbo(mbo);
@@ -1019,7 +1023,10 @@ static void most_write_completion(struct mbo *mbo)
 {
 	struct most_channel *c;
 
-	BUG_ON((!mbo) || (!mbo->context));
+	if (WARN_ONCE(!mbo || !mbo->context,
+		      "Bad mbo or missing channel reference.\n")) {
+		return;
+	}
 
 	c = mbo->context;
 	if (mbo->status == MBO_E_INVAL)
-- 
2.16.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ