From: Remy Horton Date: Thu, 17 Sep 2015 13:47:16 +0000 (+0100) Subject: ixgbe: fix access to last byte of EEPROM X-Git-Tag: spdx-start~8307 X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=6fc6a0915d934de85dce38e0abb1a3cf7f5389d0;p=dpdk.git ixgbe: fix access to last byte of EEPROM Incorrect operator in ixgbe_get_eeprom & ixgbe_set_eeprom prevents last byte of EEPROM being read/written, and hence cannot be dumped or updated in entirity using these functions. Fixes: 0198848a47f5 ("ixgbe: add access to specific device info") Signed-off-by: Remy Horton Acked-by: Konstantin Ananyev --- diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c index 0ce74792fb..d8d4173ad0 100644 --- a/drivers/net/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/ixgbe/ixgbe_ethdev.c @@ -5451,8 +5451,8 @@ ixgbe_get_eeprom(struct rte_eth_dev *dev, first = in_eeprom->offset >> 1; length = in_eeprom->length >> 1; - if ((first >= hw->eeprom.word_size) || - ((first + length) >= hw->eeprom.word_size)) + if ((first > hw->eeprom.word_size) || + ((first + length) > hw->eeprom.word_size)) return -EINVAL; in_eeprom->magic = hw->vendor_id | (hw->device_id << 16); @@ -5471,8 +5471,8 @@ ixgbe_set_eeprom(struct rte_eth_dev *dev, first = in_eeprom->offset >> 1; length = in_eeprom->length >> 1; - if ((first >= hw->eeprom.word_size) || - ((first + length) >= hw->eeprom.word_size)) + if ((first > hw->eeprom.word_size) || + ((first + length) > hw->eeprom.word_size)) return -EINVAL; in_eeprom->magic = hw->vendor_id | (hw->device_id << 16);