⬢ DragonFlyBSD Kernel Audit
DF-3724 / fix.diff
← back to finding ↓ download raw
--- a/sys/dev/netif/ix/ixgbe_x550.c
+++ b/sys/dev/netif/ix/ixgbe_x550.c
@@ -4540,6 +4540,7 @@
  **/
 s32 ixgbe_led_on_t_X550em(struct ixgbe_hw *hw, u32 led_idx)
 {
+	s32 status;
 	u16 phy_data;
 
 	DEBUGFUNC("ixgbe_led_on_t_X550em");
@@ -4548,11 +4549,17 @@
 		return IXGBE_ERR_PARAM;
 
 	/* To turn on the LED, set mode to ON. */
-	ixgbe_read_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
-			   IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE, &phy_data);
+	status = ixgbe_read_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
+				   IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
+				   &phy_data);
+	if (status != IXGBE_SUCCESS)
+		return status;
 	phy_data |= IXGBE_X557_LED_MANUAL_SET_MASK;
-	ixgbe_write_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
-			    IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE, phy_data);
+	status = ixgbe_write_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
+				     IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
+				     phy_data);
+	if (status != IXGBE_SUCCESS)
+		return status;
 
 	/* Some designs have the LEDs wired to the MAC */
 	return ixgbe_led_on_generic(hw, led_idx);
@@ -4565,6 +4572,7 @@
  **/
 s32 ixgbe_led_off_t_X550em(struct ixgbe_hw *hw, u32 led_idx)
 {
+	s32 status;
 	u16 phy_data;
 
 	DEBUGFUNC("ixgbe_led_off_t_X550em");
@@ -4573,11 +4581,17 @@
 		return IXGBE_ERR_PARAM;
 
 	/* To turn on the LED, set mode to ON. */
-	ixgbe_read_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
-			   IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE, &phy_data);
+	status = ixgbe_read_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
+				   IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
+				   &phy_data);
+	if (status != IXGBE_SUCCESS)
+		return status;
 	phy_data &= ~IXGBE_X557_LED_MANUAL_SET_MASK;
-	ixgbe_write_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
-			    IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE, phy_data);
+	status = ixgbe_write_phy_reg(hw, IXGBE_X557_LED_PROVISIONING + led_idx,
+				     IXGBE_MDIO_VENDOR_SPECIFIC_1_DEV_TYPE,
+				     phy_data);
+	if (status != IXGBE_SUCCESS)
+		return status;
 
 	/* Some designs have the LEDs wired to the MAC */
 	return ixgbe_led_off_generic(hw, led_idx);