Skip to content

Commit aa84667

Browse files
Jiawen Wukuba-moo
authored andcommitted
net: txgbe: fix eeprom calculation error
For some device types like TXGBE_ID_XAUI, *checksum computed in txgbe_calc_eeprom_checksum() is larger than TXGBE_EEPROM_SUM. Remove the limit on the size of *checksum. Fixes: 049fe53 ("net: txgbe: Add operations to interact with firmware") Fixes: 5e2ea78 ("net: txgbe: Fix unsigned comparison to zero in txgbe_calc_eeprom_checksum()") Signed-off-by: Jiawen Wu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 150e33e commit aa84667

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,9 +186,6 @@ static int txgbe_calc_eeprom_checksum(struct wx *wx, u16 *checksum)
186186
if (eeprom_ptrs)
187187
kvfree(eeprom_ptrs);
188188

189-
if (*checksum > TXGBE_EEPROM_SUM)
190-
return -EINVAL;
191-
192189
*checksum = TXGBE_EEPROM_SUM - *checksum;
193190

194191
return 0;

0 commit comments

Comments
 (0)