Skip to contentSkip to conversation

netxen: reversed condition in netxen_nic_set_link_parameters()

PATCH Applied Dan Carpenter 2 participants 2 messages May 5, 2016 – May 7, 2016

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 2/2 netxen: reversed condition in netxen_nic_set_link_parameters()

My static checker complains that we are using "autoneg" without initializing it. The problem is the ->phy_read() condition is reversed so we only set this on error instead of success.

drivers/net/ethernet/qlogic/netxen/netxen_nic_hw.c +1 -1
index a320541..2b10f1b 100644
@@ -1944,7 +1944,7 @@ void netxen_nic_set_link_parameters(struct netxen_adapter *adapter)
 				if (adapter->phy_read &&
 				    adapter->phy_read(adapter,
 						      NETXEN_NIU_GB_MII_MGMT_ADDR_AUTONEG,
-						      &autoneg) != 0)
+						      &autoneg) = 0)
 					adapter->link_autoneg = autoneg;
 			} else
 				goto link_down;
maintainer Applied
#1 lore raw

From: Dan Carpenter <[email protected]>
Date: Thu, 5 May 2016 16:19:44 +0300

Quoted 5 lines

My static checker complains that we are using "autoneg" without initializing it. The problem is the ->phy_read() condition is reversed so we only set this on error instead of success.

Applied.