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: <20240712185431.81805-1-kiryushin@ancud.ru>
Date: Fri, 12 Jul 2024 21:54:31 +0300
From: Nikita Kiryushin <kiryushin@...ud.ru>
To: Sudarsana Kalluru <skalluru@...vell.com>
Cc: Nikita Kiryushin <kiryushin@...ud.ru>,
	Manish Chopra <manishc@...vell.com>,
	"David S. Miller" <davem@...emloft.net>,
	Eric Dumazet <edumazet@...gle.com>,
	Jakub Kicinski <kuba@...nel.org>,
	Paolo Abeni <pabeni@...hat.com>,
	netdev@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	lvc-project@...uxtesting.org
Subject: [PATCH net-next] bnx2x: remove redundant NULL-pointer check

bnx2x_get_vf_config() contains NULL-pointer checks for
mac_obj and vlan_obj.

The fields checked are assigned to (after macro expansions):

mac_obj = &((vf)->vfqs[0].mac_obj);
vlan_obj = &((vf)->vfqs[0].vlan_obj);

It is impossible to get NULL for those (and (vf)->vfqs was
checked earlier in bnx2x_vf_op_prep).

Remove superfluous NULL-pointer check and associated
unreachable code to improve readability.

Signed-off-by: Nikita Kiryushin <kiryushin@...ud.ru>
---
 drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index 77d4cb4ad782..3415bbe722a8 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -2619,10 +2619,6 @@ int bnx2x_get_vf_config(struct net_device *dev, int vfidx,
 
 	mac_obj = &bnx2x_leading_vfq(vf, mac_obj);
 	vlan_obj = &bnx2x_leading_vfq(vf, vlan_obj);
-	if (!mac_obj || !vlan_obj) {
-		BNX2X_ERR("VF partially initialized\n");
-		return -EINVAL;
-	}
 
 	ivi->vf = vfidx;
 	ivi->qos = 0;
-- 
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ