From: Sasha Neftin <sasha.nef...@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: sta...@dpdk.org

Signed-off-by: Sasha Neftin <sasha.nef...@intel.com>
Signed-off-by: Anatoly Burakov <anatoly.bura...@intel.com>
---
 drivers/net/intel/igc/base/igc_i225.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/intel/igc/base/igc_i225.c 
b/drivers/net/intel/igc/base/igc_i225.c
index 1277f59885..003c060215 100644
--- a/drivers/net/intel/igc/base/igc_i225.c
+++ b/drivers/net/intel/igc/base/igc_i225.c
@@ -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;
-- 
2.43.5

Reply via email to