The variable checksum from i40e_calc_nvm_checksum is used before return
value is checked. Fix this logic.
Fixes:
8db9e2a1b232 ("i40e: base driver")
Fixes:
3ed6c3246f43 ("i40e/base: handle AQ timeout when releasing NVM")
Cc: stable@dpdk.org
Signed-off-by: Christopher Pau <christopher.pau@intel.com>
Signed-off-by: Robin Zhang <robinx.zhang@intel.com>
Acked-by: Beilei Xing <beilei.xing@intel.com>
DEBUGFUNC("i40e_update_nvm_checksum");
ret_code = i40e_calc_nvm_checksum(hw, &checksum);
- le_sum = CPU_TO_LE16(checksum);
- if (ret_code == I40E_SUCCESS)
+ if (ret_code == I40E_SUCCESS) {
+ le_sum = CPU_TO_LE16(checksum);
ret_code = i40e_write_nvm_aq(hw, 0x00, I40E_SR_SW_CHECKSUM_WORD,
1, &le_sum, true);
+ }
return ret_code;
}