Skip to content

Commit

Permalink
igb: fix nvm.ops.read() error handling
Browse files Browse the repository at this point in the history
Add error handling into igb_set_eeprom() function, in case
nvm.ops.read() fails just quit with error code asap.

Fixes: 9d5c824 ("igb: PCI-Express 82575 Gigabit Ethernet driver")
Signed-off-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
  • Loading branch information
Aleksandr Loktionov authored and Tony Nguyen committed Jun 12, 2023
1 parent c080fe2 commit 48a821f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/net/ethernet/intel/igb/igb_ethtool.c
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,8 @@ static int igb_set_eeprom(struct net_device *netdev,
*/
ret_val = hw->nvm.ops.read(hw, last_word, 1,
&eeprom_buff[last_word - first_word]);
if (ret_val)
goto out;
}

/* Device's eeprom is always little-endian, word addressable */
Expand All @@ -841,6 +843,7 @@ static int igb_set_eeprom(struct net_device *netdev,
hw->nvm.ops.update(hw);

igb_set_fw_version(adapter);
out:
kfree(eeprom_buff);
return ret_val;
}
Expand Down

0 comments on commit 48a821f

Please sign in to comment.