[v1,05/24] net/igc/base: reset loop variable
Checks
Commit Message
From: Sasha Neftin <sasha.neftin@intel.com>
When writing to Shadow RAM, we set rev_val on success, but since the value
is already set to success initially, it is possible for none of the writes
to be successful, yet ret_val will still be set to success. Fix it by
resetting the ret_val to failure before every loop iteration.
Fixes: 8cb7c57d9b3c ("net/igc: support device initialization")
Cc: stable@dpdk.org
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.burakov@intel.com>
---
drivers/net/intel/igc/base/igc_i225.c | 1 +
1 file changed, 1 insertion(+)
@@ -565,6 +565,7 @@ static s32 __igc_write_nvm_srwr(struct igc_hw *hw, u16 offset, u16 words,
}
for (i = 0; i < words; i++) {
+ ret_val = -IGC_ERR_NVM;
eewr = ((offset + i) << IGC_NVM_RW_ADDR_SHIFT) |
(data[i] << IGC_NVM_RW_REG_DATA) |
IGC_NVM_RW_REG_START;