The error checks on checksum for a negative error return always fails because
it is unsigned and can never be negative.
Fixes:
049fe5365324 ("net: txgbe: Add operations to interact with firmware")
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
if (eeprom_ptrs)
kvfree(eeprom_ptrs);
- *checksum = TXGBE_EEPROM_SUM - *checksum;
- if (*checksum < 0)
+ if (*checksum > TXGBE_EEPROM_SUM)
return -EINVAL;
+ *checksum = TXGBE_EEPROM_SUM - *checksum;
+
return 0;
}