⬢ DragonFlyBSD Kernel Audit
DF-3643 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/netif/ig_hal/e1000_ich8lan.c
+++ b/sys/dev/netif/ig_hal/e1000_ich8lan.c
@@ -956,7 +956,11 @@
 			lpi_ctrl |= I82579_LPI_CTRL_1000_ENABLE;
 
 		if (adv & dev_spec->eee_lp_ability & I82579_EEE_100_SUPPORTED) {
-			hw->phy.ops.read_reg_locked(hw, PHY_LP_ABILITY, &data);
+			ret_val = hw->phy.ops.read_reg_locked(hw,
+							     PHY_LP_ABILITY,
+							     &data);
+			if (ret_val)
+				goto release;
 			if (data & NWAY_LPAR_100TX_FD_CAPS)
 				lpi_ctrl |= I82579_LPI_CTRL_100_ENABLE;
 			else
@@ -1549,7 +1553,7 @@
 	s32 ret_val, tipg_reg = 0;
 	u16 emi_addr, emi_val = 0;
 	bool link;
-	u16 phy_reg;
+	u16 phy_reg = 0;
 
 	DEBUGFUNC("e1000_check_for_copper_link_ich8lan");
 
@@ -1762,7 +1766,10 @@
 		 * when it is passed from the PHY to the MAC to prevent
 		 * the MAC from misinterpreting the packet type.
 		 */
-		hw->phy.ops.read_reg(hw, HV_KMRN_FIFO_CTRLSTA, &phy_reg);
+		ret_val = hw->phy.ops.read_reg(hw, HV_KMRN_FIFO_CTRLSTA,
+					       &phy_reg);
+		if (ret_val)
+			return ret_val;
 		phy_reg &= ~HV_KMRN_FIFO_CTRLSTA_PREAMBLE_MASK;
 
 		if ((E1000_READ_REG(hw, E1000_STATUS) & E1000_STATUS_FD) !=
@@ -2758,7 +2765,7 @@
 s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable)
 {
 	s32 ret_val = E1000_SUCCESS;
-	u16 phy_reg, data;
+	u16 phy_reg = 0, data = 0;
 	u32 mac_reg;
 	u16 i;
 
@@ -2768,7 +2775,9 @@
 		return E1000_SUCCESS;
 
 	/* disable Rx path while enabling/disabling workaround */
-	hw->phy.ops.read_reg(hw, PHY_REG(769, 20), &phy_reg);
+	ret_val = hw->phy.ops.read_reg(hw, PHY_REG(769, 20), &phy_reg);
+	if (ret_val)
+		return ret_val;
 	ret_val = hw->phy.ops.write_reg(hw, PHY_REG(769, 20),
 					phy_reg | (1 << 14));
 	if (ret_val)