git: a8598143803d - main - ixgbe: check EEPROM read in 82599 D3 path

From: Kevin Bowling <kbowling_at_FreeBSD.org>
Date: Fri, 31 Jul 2026 11:09:14 UTC
The branch main has been updated by kbowling:

URL: https://cgit.FreeBSD.org/src/commit/?id=a8598143803d8db60568844cae86b0f330e49a1e

commit a8598143803d8db60568844cae86b0f330e49a1e
Author:     Barbara Skobiej <barbara.skobiej@intel.com>
AuthorDate: 2026-07-28 11:08:12 +0000
Commit:     Kevin Bowling <kbowling@FreeBSD.org>
CommitDate: 2026-07-31 11:07:01 +0000

    ixgbe: check EEPROM read in 82599 D3 path
    
    DPDK commit message
    
    net/ixgbe/base: fix unchecked return value
    
    Check the return value from ixgbe_read_eeprom() before using the
    control word to configure link disable during D3.
    
    Fixes:          b7ad3713b958 ("ixgbe/base: allow to disable link on D3")
    Cc: stable@dpdk.org
    
    Signed-off-by: Barbara Skobiej <barbara.skobiej@intel.com>
    Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
    Acked-by: Bruce Richardson <bruce.richardson@intel.com>
    
    Obtained from:  DPDK (eb3684b191)
    MFC after:      1 week
---
 sys/dev/ixgbe/ixgbe_82599.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/sys/dev/ixgbe/ixgbe_82599.c b/sys/dev/ixgbe/ixgbe_82599.c
index 50902c6c356d..d23c84743b33 100644
--- a/sys/dev/ixgbe/ixgbe_82599.c
+++ b/sys/dev/ixgbe/ixgbe_82599.c
@@ -609,13 +609,15 @@ out:
  **/
 void ixgbe_stop_mac_link_on_d3_82599(struct ixgbe_hw *hw)
 {
-	u32 autoc2_reg;
 	u16 ee_ctrl_2 = 0;
+	u32 autoc2_reg;
+	s32 status;
 
 	DEBUGFUNC("ixgbe_stop_mac_link_on_d3_82599");
-	ixgbe_read_eeprom(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2);
+	status = ixgbe_read_eeprom(hw, IXGBE_EEPROM_CTRL_2, &ee_ctrl_2);
 
-	if (!ixgbe_mng_present(hw) && !hw->wol_enabled &&
+	if (status == IXGBE_SUCCESS &&
+	    !ixgbe_mng_present(hw) && !hw->wol_enabled &&
 	    ee_ctrl_2 & IXGBE_EEPROM_CCD_BIT) {
 		autoc2_reg = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
 		autoc2_reg |= IXGBE_AUTOC2_LINK_DISABLE_ON_D3_MASK;