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]
Message-ID: <20200422012811.1606-1-thunder.leizhen@huawei.com>
Date:   Wed, 22 Apr 2020 09:28:11 +0800
From:   Zhen Lei <thunder.leizhen@...wei.com>
To:     Jens Axboe <axboe@...nel.dk>,
        linux-block <linux-block@...r.kernel.org>,
        linux-kernel <linux-kernel@...r.kernel.org>
CC:     Zhen Lei <thunder.leizhen@...wei.com>
Subject: [PATCH 1/1] brd: remove a redundant check

Because pages[i] can't be NULL, otherwise "pos = pages[i]->index;" will
panic. So when "ret" is NULL, it can't be equal to pages[i].

Signed-off-by: Zhen Lei <thunder.leizhen@...wei.com>
---
 drivers/block/brd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/brd.c b/drivers/block/brd.c
index 2fb25c348d53..59fec4a8ac93 100644
--- a/drivers/block/brd.c
+++ b/drivers/block/brd.c
@@ -147,7 +147,7 @@ static void brd_free_pages(struct brd_device *brd)
 			BUG_ON(pages[i]->index < pos);
 			pos = pages[i]->index;
 			ret = radix_tree_delete(&brd->brd_pages, pos);
-			BUG_ON(!ret || ret != pages[i]);
+			BUG_ON(ret != pages[i]);
 			__free_page(pages[i]);
 		}
 
-- 
2.26.0.106.g9fadedd


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ