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: <1652751208-23211-1-git-send-email-baihaowen@meizu.com>
Date:   Tue, 17 May 2022 09:33:28 +0800
From:   Haowen Bai <baihaowen@...zu.com>
To:     Dennis Dalessandro <dennis.dalessandro@...nelisnetworks.com>,
        "Jason Gunthorpe" <jgg@...pe.ca>, Leon Romanovsky <leon@...nel.org>
CC:     Haowen Bai <baihaowen@...zu.com>, <linux-rdma@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: [PATCH] RDMA: remove null check after call container_of()

container_of() will never return NULL, so remove useless code.

Signed-off-by: Haowen Bai <baihaowen@...zu.com>
---
 drivers/infiniband/sw/rdmavt/vt.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/infiniband/sw/rdmavt/vt.c b/drivers/infiniband/sw/rdmavt/vt.c
index 59481ae39505..b2d83b4958fc 100644
--- a/drivers/infiniband/sw/rdmavt/vt.c
+++ b/drivers/infiniband/sw/rdmavt/vt.c
@@ -50,8 +50,6 @@ struct rvt_dev_info *rvt_alloc_device(size_t size, int nports)
 	struct rvt_dev_info *rdi;
 
 	rdi = container_of(_ib_alloc_device(size), struct rvt_dev_info, ibdev);
-	if (!rdi)
-		return rdi;
 
 	rdi->ports = kcalloc(nports, sizeof(*rdi->ports), GFP_KERNEL);
 	if (!rdi->ports)
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ