summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Wang <xiao.w.wang@intel.com>2019-05-05 13:48:21 +0800
committerFerruh Yigit <ferruh.yigit@intel.com>2019-05-07 12:00:31 +0200
commit4e968cacb873d8497e95075b749295297745f92d (patch)
tree99bb385825ef318dbb6004395cd1dce31a99d197
parent8df10eb60ff703649510c66df7907ac1be5c21b9 (diff)
downloaddpdk-draft-windows-4e968cacb873d8497e95075b749295297745f92d.zip
dpdk-draft-windows-4e968cacb873d8497e95075b749295297745f92d.tar.gz
dpdk-draft-windows-4e968cacb873d8497e95075b749295297745f92d.tar.xz
net/ice: fix EEPROM range check
The last word should not cross shadow RAM boundary. Fixes: 68a1ab82ad74 ("net/ice: speed up to retrieve EEPROM") Cc: stable@dpdk.org Signed-off-by: Xiao Wang <xiao.w.wang@intel.com> Acked-by: Qi Zhang <qi.z.zhang@intel.com>
-rw-r--r--drivers/net/ice/ice_ethdev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c
index 7d23f5d..bbaa7cf 100644
--- a/drivers/net/ice/ice_ethdev.c
+++ b/drivers/net/ice/ice_ethdev.c
@@ -3009,8 +3009,8 @@ ice_get_eeprom(struct rte_eth_dev *dev,
last_word = (eeprom->offset + eeprom->length - 1) >> 1;
nwords = last_word - first_word + 1;
- if (first_word > hw->nvm.sr_words ||
- last_word > hw->nvm.sr_words) {
+ if (first_word >= hw->nvm.sr_words ||
+ last_word >= hw->nvm.sr_words) {
PMD_DRV_LOG(ERR, "Requested EEPROM bytes out of range.");
return -EINVAL;
}