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:   Thu, 11 Nov 2021 10:37:22 +0000
From:   cgel.zte@...il.com
To:     axboe@...nel.dk
Cc:     linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        Zhang Mingyu <zhang.mingyu@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: [PATCH] blk-mq:Use BUG_ON instead of if condition followed by BUG.

From: Zhang Mingyu <zhang.mingyu@....com.cn>

This issue was detected with the help of Coccinelle.

Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Zhang Mingyu <zhang.mingyu@....com.cn>
---
 block/blk-mq.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 7c5c8a26c8fc..05bffbc6b8ff 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -818,8 +818,7 @@ EXPORT_SYMBOL(__blk_mq_end_request);
 
 void blk_mq_end_request(struct request *rq, blk_status_t error)
 {
-	if (blk_update_request(rq, error, blk_rq_bytes(rq)))
-		BUG();
+	BUG_ON(blk_update_request(rq, error, blk_rq_bytes(rq)));
 	__blk_mq_end_request(rq, error);
 }
 EXPORT_SYMBOL(blk_mq_end_request);
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ