Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f6f2a554 authored by Aleksandr Loktionov's avatar Aleksandr Loktionov Committed by Greg Kroah-Hartman
Browse files

igb: fix nvm.ops.read() error handling



[ Upstream commit 48a821fd58837800750ec1b3962f0f799630a844 ]

Add error handling into igb_set_eeprom() function, in case
nvm.ops.read() fails just quit with error code asap.

Fixes: 9d5c8243 ("igb: PCI-Express 82575 Gigabit Ethernet driver")
Signed-off-by: default avatarAleksandr Loktionov <aleksandr.loktionov@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent aacf8ef5
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -811,6 +811,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 */
@@ -830,6 +832,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;
}