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] [day] [month] [year] [list]
Message-Id: <1510785192-10123-2-git-send-email-atull@kernel.org>
Date:   Wed, 15 Nov 2017 16:33:10 -0600
From:   Alan Tull <atull@...nel.org>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     Moritz Fischer <mdf@...nel.org>, Alan Tull <atull@...nel.org>,
        linux-kernel@...r.kernel.org, linux-fpga@...r.kernel.org,
        "Gustavo A. R. Silva" <garsilva@...eddedor.com>
Subject: [PATCH 1/3] fpga: fpga-mgr: remove unnecessary code in __fpga_mgr_get

From: "Gustavo A. R. Silva" <garsilva@...eddedor.com>

Notice that mgr = to_fpga_manager(dev); expands to:

mgr = container_of(dev, struct fpga_manager, dev);

and container_of is never null, so this null check is
unnecessary.

Addresses-Coverity-ID: 1397916
Signed-off-by: Gustavo A. R. Silva <garsilva@...eddedor.com>
Signed-off-by: Alan Tull <atull@...nel.org>
---
 drivers/fpga/fpga-mgr.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/fpga/fpga-mgr.c b/drivers/fpga/fpga-mgr.c
index 1fd5494..0b7664d 100644
--- a/drivers/fpga/fpga-mgr.c
+++ b/drivers/fpga/fpga-mgr.c
@@ -412,8 +412,6 @@ static struct fpga_manager *__fpga_mgr_get(struct device *dev)
 	struct fpga_manager *mgr;
 
 	mgr = to_fpga_manager(dev);
-	if (!mgr)
-		goto err_dev;
 
 	if (!try_module_get(dev->parent->driver->owner))
 		goto err_dev;
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ